Jump to: navigation, search

Howto:Shader programming in FlightGear

7 bytes added, 17:39, 13 October 2014
General Comments from Forum Discussion
{{cquote|In principle, we always do the same steps in the fragment shaders to determine the color of a pixel:
* texel color - what is the base color of the pixel fully lit and unfogged* lighting - how is this color changed by the light falling onto that pixel, usually the relation is something like fragColor equals texel * light* fogging - how much is the color hidden by haze, usually the relation is something like gl_FragColor equals mix(fragColor, hazeColor, transmission_factor);
what is displayed on the screen in the end is whatever gl_FragColor is set to
But the location where this happens isn't always obvious - often (part) of the light is computed in the vertex shader already, in which case it typically enters the fragment shader as gl_Color.

Navigation menu