Howto:Aircraft reflection shader: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Start of further editing of this How-To)
mNo edit summary
Line 2: Line 2:
Within [[Flightgear]] GIT and later, a reflection [[Shaders|shader]] effect is available. Only few aircrafts make already use of it, but much more will be expected soon.
Within [[Flightgear]] GIT and later, a reflection [[Shaders|shader]] effect is available. Only few aircrafts make already use of it, but much more will be expected soon.


==Reflection-Shader and Reflect-Bump-Spec-Shader
==Reflection-Shader and Reflect-Bump-Spec-Shader==
We have currently two different Reflection-Shaders.
We have currently two different Reflection-Shaders.



Revision as of 20:54, 21 September 2010

Reflection Shader applied to the B-29. It shows a shiny, high-reflective blank metal.

Within Flightgear GIT and later, a reflection shader effect is available. Only few aircrafts make already use of it, but much more will be expected soon.

Reflection-Shader and Reflect-Bump-Spec-Shader

We have currently two different Reflection-Shaders.

How to implement

Inside the Aircraft/AircraftName/Models folder, there should be a main xml file, which usually is AircraftName.xml. This file should be the one holding all information on visuals used in the aircraft. As such, we need to indicate which are to be reflectable!

Inside the AircraftName.xml, we need to put the following lines of code, shortly after or before other <animation> tag entries:

<!-- REFLECTION -->
   <effect>
       <inherits-from>Aircraft/Generic/Effects/Fuselagereflect</inherits-from>
       <object-name>Fuselage</object-name>
       <object-name>RFdoor</object-name>
       <object-name>LFdoor</object-name>
       <object-name>LRdoor</object-name>
       <object-name>RRdoor</object-name>
       <object-name>Rmain.geardoor</object-name>
       <object-name>Lmain.geardoor</object-name>
       <object-name>Engines</object-name>
       <object-name>Reversers</object-name>
       <object-name>Tail</object-name>
       <object-name>Rudder</object-name>
       <object-name>RHstab</object-name>
       <object-name>LHstab</object-name>
       <object-name>LHelevator</object-name>
       <object-name>RHelevator</object-name>
   </effect>

Note that for each <object-name> tag, you need to indicate the aircraft's objects. If you are not the original aircraft author and do not know which parts to enter, or how they are named, use the other animations tags object names which indicate the pieces you require to be reflected (such as <object-name>fuselage</object-name> is an obvious one). Obviously do not enter things which you don't want to be reflected!

To see them in sim, ensure your View > Rendering options > Effects & shaders options are checked.


article compiled by Liam Gathercole, please feel free to change/add more details if further enhancements can be made.