Modifying textures on-the-fly

Started by
3 comments, last by Byron 17 years ago
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,
a h31p1355 n00b
Advertisement


I think that the term 'decals' if searched on will turn something up....
--------------------------------------------[size="1"]Ratings are Opinion, not Fact
You would use the functions "GetSurfaceLevel(), SetRenderTarget()" to draw on the texture, and "GetBackBuffer(), SetRenderTarget()" to restore the backbuffer as the render target.
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.
++ My::Game ++
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.
ByronBoxes

This topic is closed to new replies.

Advertisement