Read Near/Far Clip plane in shader

I need the near and far clip plane values in my shader. How do I do this? I have tried gl_DepthRange.near and .far, but these values seem clapmed [0,1].


gl_DepthRange values are in window coordinates and they will always be remapped, not clamped, to [0,1].

Your perspective projection defines this range in world coordinates together with glDepthRange().
I guess you will need to pass these values as uniforms.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.