Graphics Reference
In-Depth Information
• Samplers—Used to access texture images in the shader.
• Code—Fragment shader source or binary that describes the operations
that will be performed on the fragment.
The output of the fragment shader is one or more fragment colors
that get passed on to the per-fragment operations portion of the pipeline
(the number of output colors depends on how many color attachments
are being used). The inputs and outputs to the fragment shader are
illustrated in Figure 10-2.
Un
Uniforms
Samplers
Input (Varying) 0
Input (Varying) 1
Input (Varying) 2
Output color 0
Output color 1
Fragment Shader
Input (Varying) 3
Input (Varying) 4
Input (Varying) 4
Output color N
Input (Varying) N
gl_FragCoord
gl_FragCoord
gl_FragDepth
gl_FrontFacing
gl_PointCoord
l F
F
i
Figure 10-2
OpenGL ES 3.0 Fragment Shader
Built-In Special Variables
OpenGL ES 3.0 has built-in special variables that are output by the
fragment shader or are input to the fragment shader. The following
built-in special variables are available to the fragment shader:
gl_FragCoord —A read-only variable that is available in the fragment
shader. This variable holds the window relative coordinates ( x y z , 1/ w )
 
 
Search WWH ::




Custom Search