Shader/Defined Uniforms

From OpenGL Wiki
< Shader
Revision as of 06:50, 26 July 2013 by Alfonse (talk | contribs) (fragment shader uniforms.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to 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.