1
0
Fork 0

Merge branch 'master' of \New Git\fgdata

This commit is contained in:
Vivian Meazza 2010-09-01 20:55:12 +01:00
commit f2ca47bffb
8 changed files with 24 additions and 97 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<name>Effects/cropgrass</name>
<inherits-from>Effects/terrain-default</inherits-from>
<inherits-from>Effects/crop</inherits-from>
<parameters>
<texture n="2">
<image>Textures/Terrain/cropgrass.png</image>
@ -18,92 +18,4 @@
</texture>
<snow-level><use>/sim/rendering/snow-level-m</use></snow-level>
</parameters>
<technique n="9">
<predicate>
<and>
<property>/sim/rendering/crop-shader</property>
<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>
<!-- Use material values that are either inherited from the
terrain-default effect or supplied by an effect derived
from this one e.g., one created in the materials library. -->
<material>
<ambient><use>material/ambient</use></ambient>
<diffuse><use>material/diffuse</use></diffuse>
<specular><use>material/specular</use></specular>
<color-mode>ambient-and-diffuse</color-mode>
</material>
<blend><use>transparent</use></blend>
<alpha-test><use>transparent</use></alpha-test>
<shade-model>smooth</shade-model>
<cull-face>back</cull-face>
<render-bin>
<bin-number><use>render-bin/bin-number</use></bin-number>
<bin-name><use>render-bin/bin-name</use></bin-name>
</render-bin>
<texture-unit>
<unit>0</unit>
<type>noise</type>
</texture-unit>
<texture-unit>
<unit>1</unit>
<image><use>texture[2]/image</use></image>
<filter><use>texture[2]/filter</use></filter>
<wrap-s><use>texture[2]/wrap-s</use></wrap-s>
<wrap-t><use>texture[2]/wrap-t</use></wrap-t>
<internal-format>
<use>texture[2]/internal-format</use>
</internal-format>
</texture-unit>
<texture-unit>
<unit>2</unit>
<type>1d</type>
<image><use>texture[3]/image</use></image>
<filter><use>texture[3]/filter</use></filter>
<wrap-s><use>texture[3]/wrap-s</use></wrap-s>
<internal-format>
<use>texture[3]/internal-format</use>
</internal-format>
</texture-unit>
<program>
<vertex-shader>Shaders/crop.vert</vertex-shader>
<fragment-shader>Shaders/crop.frag</fragment-shader>
</program>
<uniform>
<name>NoiseTex</name>
<type>sampler-3d</type>
<value type="int">0</value>
</uniform>
<uniform>
<name>SampleTex</name>
<type>sampler-2d</type>
<value type="int">1</value>
</uniform>
<uniform>
<name>ColorsTex</name>
<type>sampler-1d</type>
<value type="int">2</value>
</uniform>
<uniform>
<name>snowlevel</name>
<type>float</type>
<value><use>snow-level</use></value>
</uniform>
</pass>
</technique>
</PropertyList>

View file

@ -49,7 +49,7 @@
<technique n="9">
<predicate>
<and>
<property>/sim/rendering/crop-shader</property>
<property>/sim/rendering/transition-shader</property>
<property>/sim/rendering/shader-effects</property>
<or>
<less-equal>

View file

@ -49,7 +49,7 @@
<technique n="9">
<predicate>
<and>
<property>/sim/rendering/crop-shader</property>
<property>/sim/rendering/transition-shader</property>
<property>/sim/rendering/shader-effects</property>
<or>
<less-equal>

View file

@ -49,7 +49,7 @@
<technique n="9">
<predicate>
<and>
<property>/sim/rendering/crop-shader</property>
<property>/sim/rendering/transition-shader</property>
<property>/sim/rendering/shader-effects</property>
<or>
<less-equal>

View file

@ -7,6 +7,7 @@ varying vec3 VBinormal;
varying vec3 VNormal;
varying vec3 Normal;
varying float bump;
varying float fogCoord;
uniform sampler3D NoiseTex;
uniform sampler2D SampleTex;
@ -98,10 +99,8 @@ void main (void)
float vegetationlevel = (rawpos.z)+nvL[2]*3000.0;
float fogFactor;
float fogCoord = ecPosition.z;
const float LOG2 = 1.442695;
fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
float fogFactor = exp(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord);
float biasFactor = exp2(-0.00000002 * fogCoord * fogCoord * LOG2);
float n = 0.06;
@ -114,7 +113,9 @@ void main (void)
n += noisevec[2]*0.8;
n += noisevec[3]*2.1;
n = mix(0.6, n, biasFactor);
//very low n/biasFactor mix, to keep forest color
n = mix(0.05, n, biasFactor);
vec4 c1;
c1 = basecolor * vec4(smoothstep(-1.3, 0.5, n), smoothstep(-1.3, 0.5, n), smoothstep(-2.0, 0.9, n), 0.0);

View file

@ -6,6 +6,7 @@ varying vec3 VBinormal;
varying vec3 Normal;
varying vec4 constantColor;
varying float bump;
varying float fogCoord;
attribute vec3 tangent;
attribute vec3 binormal;
@ -25,4 +26,7 @@ void main(void)
+ gl_FrontColor * (gl_LightModel.ambient + gl_LightSource[0].ambient);
gl_Position = ftransform();
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
fogCoord = abs(ecPosition.z / ecPosition.w);
}

View file

@ -271,6 +271,15 @@
</binding>
</checkbox>
<checkbox>
<halign>left</halign>
<label>Transition effects</label>
<property>/sim/rendering/transition-shader</property>
<binding>
<command>dialog-apply</command>
</binding>
</checkbox>
<checkbox>
<halign>left</halign>
<label>Persistent contrails</label>

View file

@ -596,6 +596,7 @@ Started September 2000 by David Megginson, david@megginson.com
<traffic-manager>
<enabled type="bool">true</enabled>
<heuristics type="bool">true</heuristics>
<instantaneous-action type="bool">false</instantaneous-action>
<proportion>1.0</proportion>
</traffic-manager>