Reading the Z-buffer value in a post process pass?
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?
Quote:Original post by Code-RYou 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.
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?
Using the EXT_FRAMEBUFFER_OBJECTS extension is probably the best way to do this... and it should be supported on all recent graphics cards.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement