Howto:Add blackout and redout settings

From FlightGear wiki
Jump to navigation Jump to search

This is how to add blackout and redout settings to an aircraft. These settings will determine when the view will start to turn black or red and when it will be fully black or red due to g-force This is a link to a Wikipedia article.

Note  While the pilot will be temporarily blind due to g-force he will not be incapacitated (G-LOC) and will still be able to control the aircraft.

The G effect system is time based, so for example the longer time you spend at a high G the darker the screen gets.

The algorithm was used by a US military simulator and has been adapted to Flightgear.

It features gradual vision loss according to G and time in a logarithmic manner. Furthermore, once the pilot has experienced vision loss, the pilot must return G force to below a certain threshold before it starts to clear.

It also features G priming (PPE), so that if you for example pull some high Gs for a while and then go negative, the redout will take longer to come into effect, and vice versa, as the blood flows to or from the pilots brain.

Tunnel vision, redout and greyout in ALS

If running in ALS with ALS filters enabled, there will be greyout with tunnel-vision. Only the filters checkbox is needed, no need for infrared or night-vision to be enabled.

Greyout is a transient loss of vision from positive G's, it has these effects:

  • Loss of peripheral vision (aka. tunnel vision)
  • Dimming of bright light
  • Desaturation
  • Brown hue (not implemented yet)
  • When the effect is heavy, there is some noise blurring too

Redout has these effects (and no tunnel vision):

  • Red hue
  • Loss of vision

Both redout and greyout will end with 100% vision loss.

Blackout shaders in effect

G effects in Rembrandt

G effects is not implemented in Rembrandt.

G effects in HDR

A G effect has been added to HDR.

Install in aircraft

You can customize some parameters according to the quality of the G-suit the pilot is wearing and training in anti-G breathing.

Blackout and redout are controlled through these properties in /sim/rendering/redout/:

  • enabled (bool)

If the system is on or off.

  • parameters/blackout-onset-g (double) [Default = 2.5 G]
  • parameters/onset-blackout-sec (double) [Default = 300 seconds]

Onset-g must be positive and above 1. This is the G-force when the blackout effect will start to come into effect. This is also the G-force that the pilot will have to get below to clear the blackout of the screen. The time property is to set how many seconds it takes to get complete blackout at this G value.

  • parameters/blackout-complete-g (double) [Default = 4.5 G]
  • parameters/fast-blackout-sec (double) [Default = 10 seconds]

Complete-g must be higher than blackout-onset-g. This should be at or near to the maximum the pilot should be expected to tolerate depending on his G-suit and anti-G breathing techniques or lack of those. The fast-blackout-sec, is how long it will take to blackout completely at this G value. This should normally be considerably shorter than onset-blackout-sec.

  • parameters/redout-onset-g (double) [Default = -2 G]
  • parameters/redout-complete-g (double) [Default = -4 G]
  • parameters/onset-redout-sec (double) [Default = 45 seconds]
  • parameters/fast-redout-sec (double) [Default = 7.5 seconds]

These four works like the first four, just for negative Gs. Onset-g must be below 1 and complete-g must be below onset.

  • parameters/recover-fast-sec (double) [Default = 7 seconds]
  • parameters/recover-slow-sec (double) [Default = 15 seconds]

The recover-slow is how long it takes to recover from complete redout/blackout just below the onset, and recover-fast is how long it takes to clear at 1 G.

The default values, is estimated to be for a pilot without G-suit and untrained in anti-G breathing techniques. So defaults is well suited for GA aircraft.

The properties can be controlled at runtime or be added to any PropertyList XML file, for example an aircraft-set.xml or your own configuration file.

In addition to these properties there is another property, /sim/rendering/headshake/enabled (bool), that will make the pilots viewpoint move up and down due to the g-force, for example due to maneuvers or turbulence.

Minimal install

Notice that the new system from FG 2017.1.1 is somewhat backwards compatible with the older system. The old system used only these 5 properties, if you do not want to adjust it too detailed you can just set these 5, they are also the 5 that the pilot can control in the GUI:

  • enabled (bool)
  • parameters/blackout-onset-g (double)
  • parameters/blackout-complete-g (double)
  • parameters/redout-onset-g (double)
  • parameters/redout-complete-g (double)

Hearing loss

To add hearing loss, add this extra volume section to each sound effect section in the sound xml, and put this Nasal code in a 10 to 20hz loop:

var bf = getprop("sim/rendering/als-filters/black-factor");
setprop("mySounds/g-force-effect-volume", 1-bf);
<volume>
    <property>mySounds/g-force-effect-volume</property>
    <factor>1</factor>
    <offset>0</offset>
    <min>0</min>
    <max>1</max>
</volume>

Example (Fighter-jet 1979)

This example show how these setting can be added to a propertylist xml file: These blackout settings is the values used in a 1979 Langley simulator for F-16. Notice that the redout is also same as the default values, they are low because G-suits mainly protects against high G, not much against negative Gs.

<?xml version="1.0" encoding="UTF-8"?>
<PropertyList>
    <!-- ... -->
    <sim>
        <!-- ... -->
        <rendering>
            <redout>
                <enabled type="bool" userarchive="y">true</enabled>
                <parameters>
                    <blackout-onset-g type="double">5</blackout-onset-g>
                    <blackout-complete-g type="double">9</blackout-complete-g>
                    <onset-blackout-sec type="double">300</onset-blackout-sec>
                    <fast-blackout-sec type="double">10</fast-blackout-sec>
                    <redout-onset-g type="double">-2</redout-onset-g>
                    <redout-complete-g type="double">-4</redout-complete-g>
                    <onset-redout-sec type="double">45</onset-redout-sec>
                    <fast-redout-sec type="double">7.5</fast-redout-sec>
                    <recover-fast-sec type="double">7</recover-fast-sec>
                    <recover-slow-sec type="double">15</recover-slow-sec>
                </parameters>
            </redout>
            <headshake>
                <enabled type="bool" userarchive="y">true</enabled>
            </headshake>
        </rendering>
        <!-- ... -->
    </sim>
    <!-- ... -->
</PropertyList>

Example (Fighter-jet 1995)

For more modern fighters 1995+ you could set the positive G effect settings to something like this (Don't be misled by 8 vs. 9 G, its time curve is much more gentle):

blackout-onset-g    =    5;
blackout-complete-g =    8;
onset-blackout-sec  =  300;
fast-blackout-sec   =   30;

Forum topics

Mailing list threads

Source code

Main system:

Helper loops:

The basic effect is just to turn screen black/red:

The ALS filter redout system works by combining a shader effect with the effect of turning screen back/red:

The HDR effect is also shader based:

Citations