1
0
Fork 0

Merge branch 'master' of git://mapserver.flightgear.org/fgdata

This commit is contained in:
Alexis Bory 2011-02-11 21:28:22 +01:00
commit da8eef52d5
6 changed files with 282 additions and 7 deletions

14
ATC/default.transmissions Normal file
View file

@ -0,0 +1,14 @@
1 0 -1 0 "@ST approach, @CS, say again please" "Say again"
1 0 0 1 "@ST approach, @CS, request landing at @AP" "Request landing at @AP"
1 0 0 2 "@ST approach, @CS, request crossing airspace" "Request crossing airspace of @AP"
1 0 1 0 "@ST approach, @CS, aborting approach" "Abort approach to @AP"
1 1 1 0 "@ST approach, @CS, turn @TD heading @HE, @VD @AL feet" ""
1 0 1 1 "@ST approach, @CS, turning @TD heading @HE, @VD @AL feet" "Read back"
1 1 2 0 "@ST approach, @CS, turn @TD heading @HE" ""
1 0 2 1 "@ST approach, @CS, turning @TD heading @HE" "Read back"
1 1 3 0 "@ST approach, @CS, turn @TD heading @HE, You are cleared for approach to runway @RW" ""
1 0 3 1 "@ST approach, @CS, turning @TD heading @HE, Cleared to land on runway @RW" "Read back"
1 1 4 0 "@ST approach, @CS, you are @MI miles off course, turn @TD heading @HE" ""
1 0 4 1 "@ST approach, @CS, turning @TD heading @HE" "Read back"
1 1 5 0 "@ST approach, @CS, contact tower on @FR, Good day" ""

View file

@ -778,7 +778,9 @@
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/cbarw-ft</property>
<property>aero/alpha-rad</property>
<sin>
<property>aero/alpha-rad</property>
</sin>
<value>-1.8000</value>
</product>
</function>

145
Effects/lightmap.eff Normal file
View file

@ -0,0 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<name>Effects/lightmap</name>
<parameters>
<texture n ="0">
<type>white</type>
</texture>
<vertex-program-two-side type="bool">false</vertex-program-two-side>
<material>
<color-mode-uniform>1</color-mode-uniform> <!-- DIFFUSE -->
</material>
</parameters>
<technique n="10">
<predicate>
<and>
<property>/sim/rendering/shader-effects</property>
<or>
<less-equal>
<value type="float">2.0</value>
<glversion/>
</less-equal>
<and>
<extension-supported>GL_ARB_shader_objects</extension-supported>
<extension-supported>GL_ARB_shading_language_100</extension-supported>
<extension-supported>GL_ARB_vertex_shader</extension-supported>
<extension-supported>GL_ARB_fragment_shader</extension-supported>
</and>
</or>
</and>
</predicate>
<pass>
<lighting>true</lighting>
<material>
<active><use>material/active</use></active>
<ambient><use>material/ambient</use></ambient>
<diffuse><use>material/diffuse</use></diffuse>
<specular><use>material/specular</use></specular>
<emissive><use>material/emissive</use></emissive>
<shininess><use>material/shininess</use></shininess>
<color-mode><use>material/color-mode</use></color-mode>
</material>
<blend>
<active><use>blend/active</use></active>
<source><use>blend/source</use></source>
<destination><use>blend/destination</use></destination>
</blend>
<shade-model><use>shade-model</use></shade-model>
<cull-face><use>cull-face</use></cull-face>
<rendering-hint><use>rendering-hint</use></rendering-hint>
<texture-unit>
<!-- The texture unit is always active because the shaders expect
that. -->
<unit>0</unit>
<!-- If there is a texture, the type in the derived effect
will be "2d". -->
<type><use>texture[0]/type</use></type>
<image><use>texture[0]/image</use></image>
<filter><use>texture[0]/filter</use></filter>
<wrap-s><use>texture[0]/wrap-s</use></wrap-s>
<wrap-t><use>texture[0]/wrap-t</use></wrap-t>
<!--
<internal-format>
<use>texture[0]/internal-format</use>
</internal-format>
-->
</texture-unit>
<texture-unit>
<!-- The texture unit is always active because the shaders expect
that. -->
<unit>1</unit>
<!-- If there is a texture, the type in the derived effect
will be "2d". -->
<type><use>texture[1]/type</use></type>
<image><use>texture[1]/image</use></image>
<filter>linear-mipmap-linear</filter>
<wrap-s>repeat</wrap-s>
<wrap-t>repeat</wrap-t>
</texture-unit>
<vertex-program-two-side>
<use>vertex-program-two-side</use>
</vertex-program-two-side>
<program>
<vertex-shader>Shaders/lightmap.vert</vertex-shader>
<fragment-shader>Shaders/lightmap.frag</fragment-shader>
</program>
<uniform>
<name>texture</name>
<type>sampler-2d</type>
<value type="int">0</value>
</uniform>
<uniform>
<name>lightmap_texture</name>
<type>sampler-2d</type>
<value type="int">1</value>
</uniform>
<uniform>
<name>colorMode</name>
<type>int</type>
<value><use>material/color-mode-uniform</use></value>
</uniform>
</pass>
</technique>
<technique n="11">
<pass>
<lighting>true</lighting>
<material>
<active><use>material/active</use></active>
<ambient><use>material/ambient</use></ambient>
<diffuse><use>material/diffuse</use></diffuse>
<specular><use>material/specular</use></specular>
<emissive><use>material/emissive</use></emissive>
<shininess><use>material/shininess</use></shininess>
<color-mode><use>material/color-mode</use></color-mode>
</material>
<blend>
<active><use>blend/active</use></active>
<source><use>blend/source</use></source>
<destination><use>blend/destination</use></destination>
</blend>
<shade-model><use>shade-model</use></shade-model>
<cull-face><use>cull-face</use></cull-face>
<rendering-hint><use>rendering-hint</use></rendering-hint>
<texture-unit>
<active><use>texture[0]/active</use></active>
<unit>0</unit>
<image><use>texture[0]/image</use></image>
<filter><use>texture[0]/filter</use></filter>
<wrap-s><use>texture[0]/wrap-s</use></wrap-s>
<wrap-t><use>texture[0]/wrap-t</use></wrap-t>
<!--
<internal-format>
<use>texture[0]/internal-format</use>
</internal-format>
-->
<environment>
<mode>modulate</mode>
</environment>
</texture-unit>
<!-- A two-sided lighting model is set by default near the root
of the scene graph. Perhaps that ought to be set in this
effect?
-->
</pass>
</technique>
</PropertyList>

56
Shaders/lightmap.frag Normal file
View file

@ -0,0 +1,56 @@
// -*-C++-*-
// Ambient term comes in gl_Color.rgb.
//
// See http://wiki.flightgear.org/index.php/Howto:_Lightmap for details on
// how to use it.
varying vec4 diffuse_term;
varying vec3 normal;
varying float fogCoord;
uniform sampler2D texture;
uniform sampler2D lightmap_texture;
float luminance(vec3 color)
{
return dot(vec3(0.212671, 0.715160, 0.072169), color);
}
void main()
{
vec3 n, halfV;
float NdotL, NdotHV, fogFactor;
vec4 color = gl_Color;
vec3 lightDir = gl_LightSource[0].position.xyz;
vec3 halfVector = gl_LightSource[0].halfVector.xyz;
vec4 texel;
vec4 fragColor;
vec4 specular = vec4(0.0);
n = normalize(normal);
// If gl_Color.a == 0, this is a back-facing polygon and the
// normal should be reversed.
n = (2.0 * gl_Color.a - 1.0) * n;
NdotL = max(dot(n, lightDir), 0.0);
if (NdotL > 0.0) {
color += diffuse_term * NdotL;
halfV = halfVector;
NdotHV = max(dot(n, halfV), 0.0);
if (gl_FrontMaterial.shininess > 0.0)
specular.rgb = (gl_FrontMaterial.specular.rgb
* gl_LightSource[0].specular.rgb
* pow(NdotHV, gl_FrontMaterial.shininess));
}
color.a = diffuse_term.a;
// This shouldn't be necessary, but our lighting becomes very
// saturated. Clamping the color before modulating by the texture
// is closer to what the OpenGL fixed function pipeline does.
color = clamp(color, 0.0, 1.0);
texel = texture2D(texture, gl_TexCoord[0].st);
fragColor = color * texel + specular;
vec3 lightmapTexel = texture2D(lightmap_texture, gl_TexCoord[0].st).rgb;
fragColor.rgb = max(fragColor.rgb, lightmapTexel * gl_FrontMaterial.diffuse.rgb * texel.rgb);
fogFactor = exp(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord);
gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor);
}

58
Shaders/lightmap.vert Normal file
View file

@ -0,0 +1,58 @@
// -*-C++-*-
// Shader that uses OpenGL state values to do per-pixel lighting
//
// The only light used is gl_LightSource[0], which is assumed to be
// directional.
//
// Diffuse colors come from the gl_Color, ambient from the material. This is
// equivalent to osg::Material::DIFFUSE.
//
// See http://wiki.flightgear.org/index.php/Howto:_Lightmap for details on
// how to use it.
#define MODE_OFF 0
#define MODE_DIFFUSE 1
#define MODE_AMBIENT_AND_DIFFUSE 2
// The constant term of the lighting equation that doesn't depend on
// the surface normal is passed in gl_{Front,Back}Color. The alpha
// component is set to 1 for front, 0 for back in order to work around
// bugs with gl_FrontFacing in the fragment shader.
varying vec4 diffuse_term;
varying vec3 normal;
varying float fogCoord;
uniform int colorMode;
void main()
{
vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
gl_Position = ftransform();
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
normal = gl_NormalMatrix * gl_Normal;
vec4 ambient_color, diffuse_color;
if (colorMode == MODE_DIFFUSE) {
diffuse_color = gl_Color;
ambient_color = gl_FrontMaterial.ambient;
} else if (colorMode == MODE_AMBIENT_AND_DIFFUSE) {
diffuse_color = gl_Color;
ambient_color = gl_Color;
} else {
diffuse_color = gl_FrontMaterial.diffuse;
ambient_color = gl_FrontMaterial.ambient;
}
diffuse_term = diffuse_color * gl_LightSource[0].diffuse;
vec4 constant_term = gl_FrontMaterial.emission + ambient_color *
(gl_LightModel.ambient + gl_LightSource[0].ambient);
// Super hack: if diffuse material alpha is less than 1, assume a
// transparency animation is at work
if (gl_FrontMaterial.diffuse.a < 1.0)
diffuse_term.a = gl_FrontMaterial.diffuse.a;
else
diffuse_term.a = gl_Color.a;
// Another hack for supporting two-sided lighting without using
// gl_FrontFacing in the fragment shader.
gl_FrontColor.rgb = constant_term.rgb; gl_FrontColor.a = 1.0;
gl_BackColor.rgb = constant_term.rgb; gl_BackColor.a = 0.0;
fogCoord = abs(ecPosition.z / ecPosition.w);
}

View file

@ -960,14 +960,14 @@ Shared parameters for various materials.
<object-group>
<range-m>5000</range-m>
<object>
<path>Models/Buildings/cube-apartment.ac</path>
<path>Models/Buildings/medium-apartment.ac</path>
<path>Models/Residential/cube-apartment.ac</path>
<path>Models/Residential/medium-apartment.ac</path>
<path>Models/Buildings/renovated-apartment.ac</path>
<coverage-m2>1000000</coverage-m2>
<heading-type>random</heading-type>
</object>
<object>
<path>Models/Buildings/small-glass-office-building.ac</path>
<path>Models/Commercial/small-glass-office-building.ac</path>
<path>Models/Buildings/medium-glass-office-building.ac</path>
<path>Models/Buildings/small-modern-office.ac</path>
<path>Models/Buildings/small-office.ac</path>
@ -1814,14 +1814,14 @@ Shared parameters for various materials.
<object-group>
<range-m>5000</range-m>
<object>
<path>Models/Buildings/cube-apartment.ac</path>
<path>Models/Buildings/medium-apartment.ac</path>
<path>Models/Residential/cube-apartment.ac</path>
<path>Models/Residential/medium-apartment.ac</path>
<path>Models/Buildings/renovated-apartment.ac</path>
<coverage-m2>1000000</coverage-m2>
<heading-type>random</heading-type>
</object>
<object>
<path>Models/Buildings/small-glass-office-building.ac</path>
<path>Models/Commercial/small-glass-office-building.ac</path>
<path>Models/Buildings/medium-glass-office-building.ac</path>
<path>Models/Buildings/small-modern-office.ac</path>
<path>Models/Buildings/small-office.ac</path>