PDA

View Full Version : Reading DX 9 Depth Buffer (?)



cronodragon
03-11-2005, 12:11 AM
Is it possible to read the depth buffer in DX 9? If so, which interface and method should I use? And how is the data stored in the buffer?

Regards!
-Marco 8)

Sly
03-11-2005, 05:01 AM
Look at IDirect3DDevice9::GetDepthStencilSurface. It allows you to get the depth/stencil surface as a IDirect3DSurface9 object. Then use the GetDesc method of the surface to retrieve the format of the data.

cronodragon
03-11-2005, 02:04 PM
Thanks!

Clootie
03-11-2005, 07:36 PM
Forget about it.
In theory you can try to create D16_LOCKABLE depth buffer, but reading from it will be hardly effectively (from speed point).