1
0
Fork 0

g-force simulation script links to ALS g-force shaders (Nikolai Verner Christensen)

This commit is contained in:
Thorsten Renk 2017-03-18 11:10:26 +02:00
parent e901959623
commit d1dc65a207

View file

@ -4,12 +4,12 @@
## ##
## Improved redout/blackout system for Flightgear ##
## ##
## Author: Nikolai V. Chr. ##
## ##
## Todo: Tie in with Thorstens ALS greyout and tunnel vision filters ##
## Author: Nikolai V. Chr. (property rules), Thorsten Renk (shaders) ##
## ##
## ##
## Version 2.04 License: GPL 2.0 ##
## ##
## ##
## Version 2.05 License: GPL 2.0 ##
## ##
###################################################################################
-->
@ -45,6 +45,10 @@
<sum>sim/rendering/redout/internal/sum</sum>
<enable>sim/rendering/redout/enabled</enable>
<g-force>accelerations/pilot-g[0]</g-force>
<greyout>sim/rendering/als-filters/grey-factor</greyout>
<tunnel>sim/rendering/als-filters/black-factor</tunnel>
<als>sim/rendering/shaders/skydome</als>
<filters>sim/rendering/als-filters/use-filtering</filters>
</params>
<filter><!-- check for NaN -->
@ -693,6 +697,7 @@
</filter>
<filter>
<!-- When system is on, in pilot view and negative G effect, set fading color to red -->
<type>gain</type>
<gain>1</gain>
<enable>
@ -715,6 +720,7 @@
</filter>
<filter>
<!-- When system is on, in pilot view and negative G effect, set fading amount -->
<type>gain</type>
<gain>1</gain>
<enable>
@ -742,6 +748,7 @@
</filter>
<filter>
<!-- When system is on, in pilot view and positive G effect, set fading color to black -->
<type>gain</type>
<gain>1</gain>
<enable>
@ -764,6 +771,7 @@
</filter>
<filter>
<!-- When system is on, in pilot view and effect should be black, set fading amount -->
<type>gain</type>
<gain>1</gain>
<enable>
@ -780,12 +788,45 @@
</condition>
</enable>
<input>
<property alias="/params/sum"/>
<expression>
<min>
<value>1</value>
<max>
<value>0</value>
<sum>
<product>
<property alias="/params/als"/>
<property alias="/params/filters"/>
<!-- this will be used when ALS filters are in effect -->
<div>
<dif>
<property alias="/params/sum"/>
<value>0.66</value><!-- onset of blackout -->
</dif>
<value>0.34</value><!-- (full-onset) of blackout -->
</div>
</product>
<product>
<dif>
<value>1</value>
<product>
<property alias="/params/als"/>
<property alias="/params/filters"/>
</product>
</dif>
<!-- this will be used when ALS filters are off -->
<property alias="/params/sum"/>
</product>
</sum>
</max>
</min>
</expression>
</input>
<output alias="/params/alpha"/>
</filter>
<filter>
<!-- When system is off or not in pilot view, set fading to off -->
<type>gain</type>
<gain>0</gain>
<enable>
@ -808,6 +849,7 @@
</filter>
<filter>
<!-- When system disabled, set blackout amount to 0 -->
<type>gain</type>
<gain>0</gain>
<enable>
@ -824,6 +866,7 @@
</filter>
<filter>
<!-- When system is disabled, set redout amount to 0 -->
<type>gain</type>
<gain>0</gain>
<enable>
@ -839,4 +882,132 @@
<output alias="/params/redout"/>
</filter>
</PropertyList>
<filter>
<!-- When system is off or not in pilot view or negative G effect, set greyout to off -->
<type>gain</type>
<gain>0</gain>
<enable>
<condition>
<or>
<not>
<property alias="/params/enable"/>
</not>
<equals>
<property alias="/params/inside"/>
<value>0</value>
</equals>
<less-than>
<property alias="/params/sum"/>
<value>0</value>
</less-than>
</or>
</condition>
</enable>
<input>
<value>0</value>
</input>
<output alias="/params/greyout"/>
</filter>
<filter>
<!-- When system is off or not in pilot view or negative G effect, set tunnel-vision to off -->
<type>gain</type>
<gain>0</gain>
<enable>
<condition>
<or>
<not>
<property alias="/params/enable"/>
</not>
<equals>
<property alias="/params/inside"/>
<value>0</value>
</equals>
<less-than>
<property alias="/params/sum"/>
<value>0</value>
</less-than>
</or>
</condition>
</enable>
<input>
<value>0</value>
</input>
<output alias="/params/tunnel"/>
</filter>
<filter>
<!-- When system is on, in pilot view and positive G effect, set tunnel-vision amount -->
<type>gain</type>
<gain>1</gain>
<enable>
<condition>
<property alias="/params/enable"/>
<equals>
<property alias="/params/inside"/>
<value>1</value>
</equals>
<greater-than-equals>
<property alias="/params/sum"/>
<value>0</value>
</greater-than-equals>
</condition>
</enable>
<input>
<expression>
<min>
<value>1</value>
<max>
<value>0</value>
<div>
<dif>
<property alias="/params/sum"/>
<value>0.35</value><!-- onset of tunnel -->
</dif>
<value>0.65</value><!-- (full-onset) of tunnel -->
</div>
</max>
</min>
</expression>
</input>
<output alias="/params/tunnel"/>
</filter>
<filter>
<!-- When system is on, in pilot view and positive G effect, set greyout amount -->
<type>gain</type>
<gain>1</gain>
<enable>
<condition>
<property alias="/params/enable"/>
<equals>
<property alias="/params/inside"/>
<value>1</value>
</equals>
<greater-than-equals>
<property alias="/params/sum"/>
<value>0</value>
</greater-than-equals>
</condition>
</enable>
<input>
<expression>
<min>
<value>1</value>
<max>
<value>0</value>
<div>
<dif>
<property alias="/params/sum"/>
<value>0.15</value><!-- onset of greyout -->
</dif>
<value>0.65</value><!-- (full-onset) of greyout -->
</div>
</max>
</min>
</expression>
</input>
<output alias="/params/greyout"/>
</filter>
</PropertyList>