Read float from video memory
Hi all !
I have to 'download' a small texture from the video memory, and read it. Problem is that the texture is float, like D3DFMT_G16R16F or D3DFMT_R16F.
The first annoying problem is that i can't use CreateOffscreenPlainSurface with D3DFMT_R16F and D3DPOOL_SYSTEMMEM. Does someone know why ?
But the big problem is, how do I interpret the raw bytes ? I can copy the data into a buffer, but once there, how can I read the FLOAT values ?
THANKS
Interpret the bytes as an array of D3DXFLOAT16. That type has an operator for casting to FLOAT.
You can also use D3DXFloat16To32Array().
You can also use D3DXFloat16To32Array().
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement