2
votes
1answer
402 views

Position Reconstruction from Depth by inverting Perspective Projection

I had some trouble reconstructing position from depth sampled from the depth buffer. I use the equivalent of gluPerspective in GLM. The code in GLM is: template GLM_FUNC_QUALIFIER detail::tmat4x4 ...
4
votes
1answer
734 views

The Depth buffer and Perspective

I'm having trouble understanding the behaviour of my OpenGL program; and in drawing my Z-Buffer out to the screen. It will probably be best to just start with code, here is my GLSL shader: in vec3 ...