Jump to: navigation, search

Howto:Shader programming in FlightGear

411 bytes added, 03:51, 13 October 2014
no edit summary
=== Effects File ===
{{Note|need link to Effects Doc here to explain the details of the effects file}}
==== Parameters ====
Parameter entries defined in the Effect file correspond to a property tree data container (static or variable). They will contain the data needed by the shader program to perform its magic. The type of information contained in the property tree might be program control data or variable/static data that the shader program can manipulate prior to sending on to render.
==== Technique ====
In general, the shader program and the uniforms are handled defined in between the technique tags. The technique is assigned an index to distinguish one technique from another (technique n="1"). As is the case with tree.eff, sometimes the shader program and its uniforms are defined and needed in more than one technique. In the case of tree.eff it is used in technique 4 and 5. Which means in [[Flightgear]], the tree shader set to either of the the highest two shader settings still produces ALS Lights when activated. 
==== Shader Program ====
Next comes the entry to define what Shader Program the parameters data is going to be passed to.
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 times light
fogging - how much is the color hidden by haze, usually the relation is something like gl_FragColor = mix(fragColor, hazeColor, transmission_factor);
what is displayed on the screen in the end is whatever gl_FragColor is set to

Navigation menu