• Advertisement
Sign in to follow this  

Modifying textures on-the-fly

This topic is 4032 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I am looking for a tutorial or guide or any kind of information for that matter that will make me enable writing to the textures runtime. I want to have effects like bullet-holes etc. on my textures and re-render them during runtime. Can anyone please provide me with some pointers? :) Thank you,

Share this post


Link to post
Share on other sites
Advertisement
You would use the functions "GetSurfaceLevel(), SetRenderTarget()" to draw on the texture, and "GetBackBuffer(), SetRenderTarget()" to restore the backbuffer as the render target.

Share this post


Link to post
Share on other sites
Writing to (modifying) textures at runtime seems like a bad idea in your particular case. Depending on which pool your texture is placed, this could be a slow operation. As the poster above has suggested, try googling for decals.

Share this post


Link to post
Share on other sites
Or, if decals really don't fit what you want then look into render-targets.

Manually locking a texture and writing to it is probably one of the best ways to get your code to run as slowly as possible.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement