Howto:Shader programming in FlightGear: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 348: Line 348:


== ALS Landing Lights - Spotlight ==
== ALS Landing Lights - Spotlight ==
[[File:ALS Secondary Light Proof of Concept.png|320px|ALS Secondary Light 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.
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.


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.
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
The list might include [[File:ALS Secondary Light Proof of Concept.png|320px|ALS Secondary Light Proof of Concept]]
*runway
*runway
*terrain
*terrain
Line 553: Line 553:
  }
  }


[[File:Model on Water and Trees on Land.jpg|thumb|Model on Water and Trees on Land ALS Lights Effect]]
[[File:Model on Water and Trees on Land.jpg|803px|Model on Water and Trees on Land ALS Lights Effect]]


=== tree-ALS.frag ===
=== tree-ALS.frag ===
Line 611: Line 611:
Some of the variable data contained in the shader program is used for other purposes and is introduced into the shader program from other property, parameter and uniform definitions not pertaining to ALS Lights.
Some of the variable data contained in the shader program is used for other purposes and is introduced into the shader program from other property, parameter and uniform definitions not pertaining to ALS Lights.


[[File:Model on Water.jpg|thumb|ALS Lights Effect over model and water.]]
[[File:Model on Water.jpg|640px|ALS Lights Effect over model and water.]]


==== File List ====
==== File List ====
330

edits