Howto:Shader programming in FlightGear: Difference between revisions

m
Line 141: Line 141:
Note: Loading a fragment shader turns off parts of the OpenGL pipeline (pixel shaders fully replace the "Texturing Unit")
Note: Loading a fragment shader turns off parts of the OpenGL pipeline (pixel shaders fully replace the "Texturing Unit")


The other shader (the "Fragment shader" - also known (incorrectly) as the "Pixel shader") takes one pixel from the rasterizer and generates one pixel to write or blend into the frame buffer.  
The other shader (the "Fragment shader" - also known (incorrectly) as the "pixel shader") takes one pixel from the rasterizer and generates one pixel to write or blend into the frame buffer.  
 
A fragment shader can write to the following special output variables:
* gl_FragColor to set the color of the fragment
* gl_FragData[n] to output to a specific render target
* gl_FragDepth to set the fragment depth
 


Common tasks of fragment shaders include:
Common tasks of fragment shaders include:
2,561

edits