Shader

From FlightGear wiki
Revision as of 18:41, 3 January 2015 by Johan G (talk | contribs) (→‎Related content: + Model-combined effect)
Jump to navigation Jump to search
The (advanced) shader dialog, as seen on 2.6.0.

A shader is a set of software instructions, which is used primarily to calculate rendering effects on graphics hardware, like water reflections and shadows.

Shaders in FlightGear

FlightGear supports shaders since the switch from PLIB to OSG (FlightGear 1.9.0). FlightGear 2.0 added the ability to program shaders and effects more easily (without modifying the core code) and use them for terrain and model materials. Old hard-coded shaders like the chrome shader or the random trees in the scenery were converted to the new system.

The Performance vs Quality slider in the View > Rendering Options dialog provides basic control. At the right most position, all enabled shaders will be shown at maximum quality. Most shaders are simple on/off, but some of the more demanding shaders have intermediate steps. Powerfull graphics cards have no problem with the maximum quality setting, but most cards (even modern ones) need a finetuned setting to maintain reasonable framerates.

FlightGear 2.6.0

As of 2.6.0, you can change individual shader's settings in the Shader Options dialog, which can be reached via the button in the Rendering Options dialog. Some aircraft are equipped with custom shaders, those will show up under "Aircraft" in the very same dialog. Setting the Performance vs Quality slider all the way to the left will disable all shaders.

Another novelty is the so called uber shader; one effect that controls several shaders. This allows an aircraft (or any model actually) to have lightmap, normalmap as well as reflection map applied. For details and usage instructions, see http://gitorious.org/fg/fgdata/blobs/master/Docs/README.effects

Disabling Shaders

It's possible that the FlightGear default shader settings are not supported with your hardware/drivers, so that the process will be killed by the OS because it's trying to do something not supported by your computer. If you are experiencing full system crashes, you should see System Crashes instead.

By default, FlightGear 2.6+ will assume a certain runtime environment and certain GPU features which may not be suppported by most older cards (e.g. shader support), such as GeForce 6/7 generation hardware and most older hardware (older than 4-5 years), so that it can be expected that FG will probably not work on such computers "out of the box" and may get terminated by your operating system eventually, i.e. the default startup settings will need to be customized accordingly, to disable all unsupported default features. See Troubleshooting performance issues, Problematic Video Cards and FlightGear Hardware Recommendations for more details.

Also, make sure you've got the newest driver for your video card installed and running without errors. A suggestion for a thorough updating procedure can be found at Graphics drivers configuration.

Use the following startup arguments to disable shaders altogether:

  • --prop:/sim/rendering/quality-level=0
  • --prop:/sim/rendering/shaders/quality-level=0

Related content

Image:SnowAtAltitude1.jpg Image:SnowAtAltitude2.jpg Image:SnowAtAltitude1.jpg Image:SnowAtAltitude2.jpg

Scenery around LFLJ with the snow effect disabled (left) and enabled (right).

Scenery around TNCM with water reflections disabled (left) and enabled (right).

Related content