Howto:Shader programming in FlightGear: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 355: Line 355:


===Preferences/Nasal/XML===
===Preferences/Nasal/XML===
{{Note|need link to Preferences, Nasal and XML Docs here}}
Any combination of Preferences, Nasal or XML manipulates data in the property tree.  
Any combination of Preferences, Nasal or XML manipulates data in the property tree.  
In this case the switch to turn on the landing or spot light and a couple other needed data containers are defined in $FG_ROOT/preferences.xml with the following lines.
In this case the switch to turn on the landing or spot light and a couple other needed data containers are defined in $FG_ROOT/preferences.xml with the following lines.
Line 364: Line 365:
   <landing-light2-offset-deg type="float">0.0</landing-light2-offset-deg>
   <landing-light2-offset-deg type="float">0.0</landing-light2-offset-deg>
  </als-secondary-lights>
  </als-secondary-lights>
They show up in the Property Tree under sim/rendering/als-secondary-lights and can be activated or manipulated by normal Nasal calls or XML.


===Effects File===
===Effects File===
Line 383: Line 385:
  <tquality_level><use>/sim/rendering/shaders/transition</use></tquality_level>
  <tquality_level><use>/sim/rendering/shaders/transition</use></tquality_level>
</small>
</small>
Note the "use-searchlight" entry, it is pointing to the use-searchlight entry in the property tree under "sim/rendering/als-secondary-lights" that was defined in preferences.xml.
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.
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.
   
   
330

edits