Changes

Jump to: navigation, search

Howto:Shader programming in FlightGear

945 bytes added, 22:32, 12 October 2014
no edit summary
[[File:als secondary light.png|640px|thumbnail|Proof of Concept]]
The ALS Landing Lights\Spotlight (we'll call it ALS Lights from now on) is a good example for showing how to incorporate a shader effect into [[Flightgear]] as it touches many parts of the visuals we see and many parts of the coding pipeline.
You have ALS Lights effect you have to
In the case of ALS Lights, you have to add the effect to every visual item rendered on the screen that you want to see a light shining on. If you want it to be capable of shining on everything, you have to account for each separate item and how that item is rendered. That is a lot of code to touch.
The list might include
*runway
*terrain
*models
**ai
**aircraft
**tree
*weather
**fog
**clouds
**hazes
*water
 
The example highlighted in this articular is was was added to model-defaut.eff
=== Program Flow Simplified ===
Some of this data may play a duel role inside the shader program. In other words it might be used to control other functions in addition to ALS Lights.
There will also be other parameter entries that have nothing to do with ALS Lights. They might be used for other actions or effects the shader is handling.
==== Shader Program ====
Next comes the entry to define what Shader Program the parameters data is going to be passed to.
<program>
<fragment-shader>Shaders/model-ALS-base.frag</fragment-shader>
<fragment-shader>Shaders/secondary_lights.frag</fragment-shader>
</program>
 
==== Uniforms ====
266
edits

Navigation menu