Sign in to follow this  
ErikPersson

Depth reading?

Recommended Posts

ErikPersson    140
Is it possible to read z values from the depth buffer or do i need to render the z values to a texture (and if so how is this done) to obtain depth information? I havent found any pixel shader instruction that gets the depth value from the depth buffer and I find this strange since the depth buffer gets read/written to for every pixel, if depth buffering is enabled.

Share this post


Link to post
Share on other sites
Agony    3452
Well, I know you can create your own depth/stencil surface, and then use pDevice->SetDepthStencilSurface() to make the device use that surface. Then you can lock it to get access to it. Don't know if you can read from it while using it though...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this