CoglSnippet shader api for fog
Fogging causes vertices that are further away from the eye to be rendered with a different color. The color is determined according to the
chosen fog mode; at it's simplest the color is linearly interpolated so that vertices at
z_near are drawn fully with their original
color and vertices at
z_far are drawn fully with
fog_color. Fogging will remain enabled until you call
The fogging functions only work correctly when primitives use unmultiplied alpha colors. By default Cogl will premultiply textures and set_source_color will premultiply colors, so unless you explicitly load your textures requesting an unmultiplied internal format and use set_color you can only use fogging with fully opaque primitives. This might improve in the future when we can depend on fragment shaders.
The color of the fog
A FogMode that determines the equation used to calculate the fogging blend factor.
Position along Z axis where no fogging should be applied
Position along Z axis where full fogging should be applied