Sign in to follow this  
Code-R

Reading the Z-buffer value in a post process pass?

Recommended Posts

how can I read the z-buffer value form a post process path? is there somehow to access the current z-buffer value or will I have to add a new path where I render Z to a floating point texture?

Share this post


Link to post
Share on other sites
Quote:
Original post by Code-R
how can I read the z-buffer value form a post process path? is there somehow to access the current z-buffer value or will I have to add a new path where I render Z to a floating point texture?
You can use glReadPixels with format set to GL_DEPTH_COMPONENT to access the current depth buffer values. It may not be the fastest operation though. I would suggest rendering depth to a texture, making use of multiple render targets if they are available to you.

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