Texture Pixel Data
Hi,
I need to access individual pixel data for a texture so it can be altered during runtime. Is this possible? I.e. I want to start with a plain white texture, and based on events that occur during runtime, I want to increase the colour for certain pixels of the texture. Any ideas?
Cheers
See IDirect3DTexture9::LockRect().
Note: There is related functionality for surfaces, where each type of image (texture, render target, 3d texture, etc...) have an associated IDreict3DSurface9, but you don't need to get the surface interface to update a texture.
Note: There is related functionality for surfaces, where each type of image (texture, render target, 3d texture, etc...) have an associated IDreict3DSurface9, but you don't need to get the surface interface to update a texture.
This sounds like a perfect opportunity to use a fragment shader. Inside your fragment shader you could determine if a given element of your texture is the color you want to be changing. You could pass in a variable from the application (not sure how this is done in HLSL) to determine if it's time to change this particular element of the texture.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement