Modifying textures on-the-fly
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,
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement