Hello,
I'm trying to read the depth buffer in a Direct3D 8 application.
According to the documentation, this is only possible with the D3DLOCK_D16_LOCKABLE format.
The problem is that the application uses a D3DFMT_D24S8 format (and i cannot change it, because it creates serious artifacts during the rendering).
I have been trying several tricks like CopyRect from the Depth Buffer surface to a new surface, LockRect with different flags, creating the Depth Buffer as a texture with D3DUSAGE_DEPTHSTENCIL, ...
I wanted to create my own fake version of AO, but i guess that without reading the z values that i need, it's going to be impossible.
Does anybody know a trick to read the Z values from D3D8 ? Maybe with a shader that uses the depth buffer in a texture stage, and writes the Z values to a new texture with render target flags. Did anybody success to this in the past ?
Thank you very much !
I'm trying to read the depth buffer in a Direct3D 8 application.
According to the documentation, this is only possible with the D3DLOCK_D16_LOCKABLE format.
The problem is that the application uses a D3DFMT_D24S8 format (and i cannot change it, because it creates serious artifacts during the rendering).
I have been trying several tricks like CopyRect from the Depth Buffer surface to a new surface, LockRect with different flags, creating the Depth Buffer as a texture with D3DUSAGE_DEPTHSTENCIL, ...
I wanted to create my own fake version of AO, but i guess that without reading the z values that i need, it's going to be impossible.
Does anybody know a trick to read the Z values from D3D8 ? Maybe with a shader that uses the depth buffer in a texture stage, and writes the Z values to a new texture with render target flags. Did anybody success to this in the past ?
Thank you very much !