PDA

View Full Version : Read Near/Far Clip plane in shader



CelticDaddio
05-05-2006, 12:36 PM
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].

Thanks,
CD

def
05-05-2006, 07:58 PM
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.