Skip to main content
deleted 73 characters in body
Source Link
Kromster
  • 10.7k
  • 4
  • 55
  • 67

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.

I have a buffer I am rendering 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.

I have a buffer I am rendering 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.

Source Link

Get world position from depth buffer

I have a buffer I am rendering 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.