Archived

This topic is now archived and is closed to further replies.

flaXen

Dynamic textures

Recommended Posts

My game engine implements a highly powerful procedural effects engine. All effects are rendered in software and uploaded to the video car. I know that constantly uploading textures can impact speed quite a bit. Is there a good solution to this? I have considered pre-rendering a number of frames and looping them, but for some effects which are a little more interactive, that won''t work. So is there a "good" way to do dynamic textures in D3D8? Thanks, -- Dan (flaXen)

Share this post


Link to post
Share on other sites
If you keep outputting to a image file and then uploading that file to the video card your app is going to hurt big time. If you need to support procedural textures, you should look into using the programmable shading pipleline via pixel shdaers. The only problem with that is that the user will have to have a Geforce3 or newer (I guess they could have a Radeon 8500, but the way ATI is cheating on their benchmarks, I dont think they are going to get much sales)

If this is a problem for you (you have to support older video cards), you could try to dump the image data right onto an IDirect3DSurface8 interface, and then converting the Surface into a texture, then setting the texture. There are a couple articles on Gamasutra.com on how to render to a texture.

If you are not outputting the image data to a file every frame, and are just using the ->SetTexture method every frame, you should be ok as you are.

Share this post


Link to post
Share on other sites
Can't you render to a target, as in an offscreen surface? That would make more sense than rendering to a system mem surface and then uploading that to the vid card. Take a look at the DX8 SDK docs for drawprimitive. I think one of the parameters is to render to a target. I think thats how it works.

Edited by - Moe on November 9, 2001 12:01:27 AM

Share this post


Link to post
Share on other sites
actualy moe, i think the best way to do it is to use the ID3DXRenderToSurface interface

its pretty easy all you do is specify the surface to which you want to render and start drawing away.

Share this post


Link to post
Share on other sites
Since its D3DX, its my guess that it does use a render target for drawprimitive, and that its just a fancy wrapper. Mind you I am probably wrong...

Share this post


Link to post
Share on other sites