Fragment Shader/Defined Uniforms

Jump to: navigation, search

Fragment Shaders define the following uniforms.

struct gl_DepthRangeParameters
    float near;
    float far;
    float diff;
uniform gl_DepthRangeParameters gl_DepthRange;

This struct provides access to the glDepthRange near and far values. The diff​ value is the far​ value minus the near​ value. Do recall that OpenGL makes no requirement that far​ is greater than near​.