I have a buffer I am rendering gl_FragDepth gl_FragDepth (remapped to range 0-1) to a color buffer (instead of color) in OpenGL
I would like to, in a second pass, read this depth and use the x and y coordinates of the current fragment to re-calculate the world coordinates.
I'm rendering my scene to an FBO, then I screenquad this FBO's contents to the screen and during that render i'd like to find the worldspace coordinates I rendered with initially.
I'm desperate for help and I cannot find a solution. Please, I beg you.