Archived

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

ZeroBit

Render to Texture

Recommended Posts

ZeroBit    122
Hi ! Wondering what is the fastest way to do create a procedural texture ? Is it done by locking the surface level of the texture and blitting / manipulating the surface memory directly or setting the texture as a render target ? Is the second method supported by all video card (setting the texture as render Target) ? Cheers, Chris

Share this post


Link to post
Share on other sites
Scarab    122
There are a couple of ways: you can either (a) just go ahead, lock the texture and fiddle with it directly or (b) keep a copy in system memory, fiddle THAT, and copy it into the texture just before you make your rendering pass. I''m playing with procedurals a little now, so I don''t really have any kind of performance figures on one method vs. the other.. except that locks are expensive IIRC.

Not sure how well supported render to texture is, sorry.

Share this post


Link to post
Share on other sites
Halloween    122
You should do as little as you can between Lock and Unlock, so it is better to create two textures - one in system memory, one in the video memory (D3DPOOL_DEFAULT), then you make all operations on the system memory surface, and when texture is created you do UpdateTexture to the video memory.
Sure that is fine unless you want to do hardware-accelerated rendering while creating your texture.
...as for the render target, AFAIK not every hardware supports this.

P.S. Maybe I am wrong somewhere, so don''t trust me too much...

Share this post


Link to post
Share on other sites