Shader/Defined Uniforms: Difference between revisions
< Shader
fragment shader uniforms. |
Adding gl_NumSamples to uniforms. |
||
Line 9: | Line 9: | ||
}; | }; | ||
uniform gl_DepthRangeParameters gl_DepthRange; | uniform gl_DepthRangeParameters gl_DepthRange; | ||
uniform int gl_NumSamples; //GLSL 4.20 | |||
</source> | </source> | ||
This struct provides access to the {{apifunc|glDepthRange}} near and far values. The {{code|diff}} value is the {{code|far}} value minus the {{code|near}} value. Do recall that OpenGL makes no requirement that {{code|far}} is greater than {{code|near}}. | This struct provides access to the {{apifunc|glDepthRange}} near and far values. The {{code|diff}} value is the {{code|far}} value minus the {{code|near}} value. Do recall that OpenGL makes no requirement that {{code|far}} is greater than {{code|near}}. | ||
{{code|gl_NumSamples}} is the number of samples in the current [[Framebuffer]]. If the framebuffer is not multisampled, then this value will be 1. |
Revision as of 15:59, 3 May 2015
Fragment Shaders define the following uniforms.
struct gl_DepthRangeParameters
{
float near;
float far;
float diff;
};
uniform gl_DepthRangeParameters gl_DepthRange;
uniform int gl_NumSamples; //GLSL 4.20
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.
gl_NumSamples is the number of samples in the current Framebuffer. If the framebuffer is not multisampled, then this value will be 1.