• Advertisement
Sign in to follow this  

Directx 10.0 Texture Colour Values

This topic is 2742 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

Hi all,

Fairly straight forward question. I need to extract a buffer containing a textures colour values at each pixel. I have seen an example in DirectX 9 but it was using LockRects etc.

I am using shaders in game and create ID3D10ShaderResourceView to handle the texture objects. Is there a way to extract the details simply through that object, or another texture object DirectX offers?

Cheers guys, any help appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Are you saying you want to be able to read the texel values of a texture on the CPU? If this is the case, you need to obtain a pointer to the underlying resource for the shader resource view. You can do this by calling GetResource on it to get an ID3D10Resource. You can then cast that to an ID3D10Texture2D, and call Map on it to read back the texels.

Share this post


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

  • Advertisement