Merge branch 'master' of git://mapserver.flightgear.org/fgdata
This commit is contained in:
commit
793067301c
5 changed files with 70 additions and 25 deletions
|
@ -33,11 +33,14 @@
|
|||
<animation>
|
||||
<type>material</type>
|
||||
<object-name>egt</object-name>
|
||||
<object-name>Needle</object-name>
|
||||
<object-name>Bug</object-name>
|
||||
<object-name>Face</object-name>
|
||||
<emission>
|
||||
<red-prop>sim/model/instrument-lighting/emission/red</red-prop>
|
||||
<green-prop>sim/model/instrument-lighting/emission/green</green-prop>
|
||||
<blue-prop>sim/model/instrument-lighting/emission/blue</blue-prop>
|
||||
<factor-prop>controls/lighting/instruments-norm</factor-prop>
|
||||
<red>1.0</red>
|
||||
<green>0.2</green>
|
||||
<blue>0.0</blue>
|
||||
<factor-prop>sim/model/material/instruments/factor</factor-prop>
|
||||
</emission>
|
||||
</animation>
|
||||
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
<name>Ctrl-c</name>
|
||||
<desc>Panel hotspots and labels</desc>
|
||||
</key>
|
||||
<key>
|
||||
<name>l/L</name>
|
||||
<desc>Increase/decrease panel lighting</desc>
|
||||
</key>
|
||||
<line/>
|
||||
<line>_________Engine Start Checklist_________</line>
|
||||
<line>Mixture: Rich</line>
|
||||
|
|
|
@ -241,23 +241,47 @@ Started October 23 2001 by John Check, fgpanels@rockfish.net
|
|||
</payload>
|
||||
|
||||
<input>
|
||||
<keyboard>
|
||||
<key n="115">
|
||||
<name>s</name>
|
||||
<desc>Toggle Starter Switch</desc>
|
||||
<binding>
|
||||
<command>property-assign</command>
|
||||
<property>/controls/switches/starter</property>
|
||||
<value >1</value>
|
||||
</binding>
|
||||
<mod-up>
|
||||
<binding>
|
||||
<command>property-assign</command>
|
||||
<property>/controls/switches/starter</property>
|
||||
<value>0</value>
|
||||
</binding>
|
||||
</mod-up>
|
||||
</key>
|
||||
<keyboard>
|
||||
<key n="76">
|
||||
<name>L</name>
|
||||
<desc>Decrease Panel lighting</desc>
|
||||
<binding>
|
||||
<command>property-adjust</command>
|
||||
<property>controls/lighting/instruments-norm</property>
|
||||
<step>-0.1</step>
|
||||
<min>0</min>
|
||||
<max>1.0</max>
|
||||
<wrap>0</wrap>
|
||||
</binding>
|
||||
</key>
|
||||
<key n="108">
|
||||
<name>l</name>
|
||||
<desc>Increase Panel lighting</desc>
|
||||
<binding>
|
||||
<command>property-adjust</command>
|
||||
<property>controls/lighting/instruments-norm</property>
|
||||
<step>0.1</step>
|
||||
<min>0</min>
|
||||
<max>1.0</max>
|
||||
<wrap>0</wrap>
|
||||
</binding>
|
||||
</key>
|
||||
<key n="115">
|
||||
<name>s</name>
|
||||
<desc>Toggle Starter Switch</desc>
|
||||
<binding>
|
||||
<command>property-assign</command>
|
||||
<property>/controls/switches/starter</property>
|
||||
<value >1</value>
|
||||
</binding>
|
||||
<mod-up>
|
||||
<binding>
|
||||
<command>property-assign</command>
|
||||
<property>/controls/switches/starter</property>
|
||||
<value>0</value>
|
||||
</binding>
|
||||
</mod-up>
|
||||
</key>
|
||||
</keyboard>
|
||||
</input>
|
||||
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
<parameters>
|
||||
<texture n ="0">
|
||||
</texture>
|
||||
<range>
|
||||
<use>/sim/rendering/clouds3d-vis-range</use>
|
||||
</range>
|
||||
</parameters>
|
||||
<technique n="10">
|
||||
<predicate>
|
||||
|
@ -63,6 +66,11 @@
|
|||
<type>sampler-2d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>range</name>
|
||||
<type>float</type>
|
||||
<value><use>range</use></value>
|
||||
</uniform>
|
||||
<vertex-program-two-side>true</vertex-program-two-side>
|
||||
</pass>
|
||||
</technique>
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
varying float fogFactor;
|
||||
|
||||
uniform float range; // From /sim/rendering/clouds3d-vis-range
|
||||
|
||||
attribute vec3 usrAttr1;
|
||||
attribute vec3 usrAttr2;
|
||||
|
||||
|
@ -40,26 +42,30 @@ void main(void)
|
|||
// Determine a lighting normal based on the vertex position from the
|
||||
// center of the cloud, so that sprite on the opposite side of the cloud to the sun are darker.
|
||||
float n = dot(normalize(-gl_LightSource[0].position.xyz),
|
||||
normalize(vec3(gl_ModelViewMatrix * vec4(- gl_Position.xyz,0.0))));
|
||||
normalize(vec3(gl_ModelViewMatrix * vec4(- gl_Position.x, - gl_Position.y, - gl_Position.z,0.0))));
|
||||
|
||||
// Determine the position - used for fog and shading calculations
|
||||
vec3 ecPosition = vec3(gl_ModelViewMatrix * gl_Position);
|
||||
float fogCoord = abs(ecPosition.z);
|
||||
|
||||
// Determine fractional height of vertex from 0 at the bottom, and 1 at mid-height.
|
||||
// Used to determine shading.
|
||||
float fract = smoothstep(0.0, cloud_height, gl_Position.z + cloud_height);
|
||||
|
||||
// Final position of the sprite
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Position;
|
||||
|
||||
// Determine the shading of the sprite based on its vertical position and position relative to the sun.
|
||||
// Determine the shading of the sprite based on its vertical position and position relative to the sun.
|
||||
n = min(smoothstep(-0.5, 0.0, n), fract);
|
||||
// Determine the shading based on a mixture from the backlight to the front
|
||||
|
||||
// Determine the shading based on a mixture from the backlight to the front
|
||||
vec4 backlight = gl_LightSource[0].diffuse * shade;
|
||||
|
||||
gl_FrontColor = mix(backlight, gl_LightSource[0].diffuse, n);
|
||||
gl_FrontColor += gl_FrontLightModelProduct.sceneColor;
|
||||
|
||||
// As we get within 100m of the sprite, it is faded out. Equally at large distances it also fades out.
|
||||
gl_FrontColor.a = min(smoothstep(10.0, 100.0, fogCoord), 1.0 - smoothstep(15000.0, 20000.0, fogCoord));
|
||||
gl_FrontColor.a = min(smoothstep(10.0, 100.0, fogCoord), 1.0 - smoothstep(range*0.8, range, fogCoord));
|
||||
gl_BackColor = gl_FrontColor;
|
||||
|
||||
// Fog doesn't affect clouds as much as other objects.
|
||||
|
|
Loading…
Add table
Reference in a new issue