Howto:Add effects to an aircraft

From FlightGear wiki
Revision as of 10:18, 22 June 2017 by Thorsten (talk | contribs) (Created page with " {{WIP}} This article is an introduction how to use the Flightgear Effect framework as a contributor - mainly for aircraft, but in principle also for scenery models. == What...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
WIP.png Work in progress
This article or section will be worked on in the upcoming hours or days.
See history for the latest developments.

This article is an introduction how to use the Flightgear Effect framework as a contributor - mainly for aircraft, but in principle also for scenery models.

What are effects?

Simply put, effects are instructions for the graphics card how a given surface is rendered. In FG, most effects can be seen as something like configuration files for [[Shaders] (i.e. GLSL code that is directly executed on the graphics card).

Per default, all meshes are processed using a Blinn-Phong shading model which uses a combination of ambient, diffuse and specular lighting. This looks generally acceptable, but does not really capture the properties of many materials.

GLSL shaders on the other hand can (and do) solve much more complicated lighting equations than Blinn-Phong does, taking into account things like environment reflections, Fresnel small angle reflections, diffuse irradiance from skylight, etc. In addition, shaders can also process additional information on structures not captured by the 3d mesh triangles, for instance via normal maps.

To get a visual idea, compare the following two images (you may have to magnify them to fullscreen to appreciate the details). The first one is processed by a default Blinn-Phong scheme.

The EC 130 rendered in a Blinn-Phong shading model

The second one is processed by a shader which utilizes among other things normal and irradiance mapping:

The EC 130 rendered using the model-combined effect

The differences are perhaps subtle, but combine to a much more realistic impression. Thus, effects are what turns a good 3d model into a great 3d model.