Dynamic textures

Started by
3 comments, last by flaXen 22 years, 5 months ago
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)
Advertisement
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.
"This is stupid. I can't believe this! Ok, this time, there really IS a bug in the compiler."... 20 mins pass ..."I'M AN IDIOT!!!"
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
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.
"This is stupid. I can't believe this! Ok, this time, there really IS a bug in the compiler."... 20 mins pass ..."I'M AN IDIOT!!!"
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...

This topic is closed to new replies.

Advertisement