Merge branch 'master' of git://gitorious.org/fg/fgdata
This commit is contained in:
commit
45c56e51bc
6 changed files with 258 additions and 37 deletions
|
@ -173,6 +173,15 @@ property-assign - assign a value to a property
|
||||||
value: the new value for the property; or
|
value: the new value for the property; or
|
||||||
property[1]: the name of the property holding the new value.
|
property[1]: the name of the property holding the new value.
|
||||||
|
|
||||||
|
property-interpolate - assign a value to a property, interpolated
|
||||||
|
over time
|
||||||
|
property[0]: the name of the property that will get the new value
|
||||||
|
and defines the starting point of the interpolation
|
||||||
|
value: the new value for the property; or
|
||||||
|
property[1]: the name of the property holding the new value.
|
||||||
|
time: the time in seconds it takes for the transition from the
|
||||||
|
old value to the new value of property[0]
|
||||||
|
|
||||||
property-adjust - adjust the value of a property
|
property-adjust - adjust the value of a property
|
||||||
property: the name of the property to increment or decrement
|
property: the name of the property to increment or decrement
|
||||||
step: the amount of the increment or decrement (defaults to 0)
|
step: the amount of the increment or decrement (defaults to 0)
|
||||||
|
|
|
@ -40,6 +40,26 @@
|
||||||
<season-green type="float">0.86</season-green>
|
<season-green type="float">0.86</season-green>
|
||||||
<season-blue type="float">0.22</season-blue>
|
<season-blue type="float">0.22</season-blue>
|
||||||
<!-- end season color -->
|
<!-- end season color -->
|
||||||
|
<!--fog include-->
|
||||||
|
<visibility>
|
||||||
|
<use>/environment/ground-visibility-m</use>
|
||||||
|
</visibility>
|
||||||
|
<avisibility>
|
||||||
|
<use>/environment/visibility-m</use>
|
||||||
|
</avisibility>
|
||||||
|
<lthickness>
|
||||||
|
<use>/environment/ground-haze-thickness-m</use>
|
||||||
|
</lthickness>
|
||||||
|
<scattering>
|
||||||
|
<use>/rendering/scene/scattering</use>
|
||||||
|
</scattering>
|
||||||
|
<terminator>
|
||||||
|
<use>/environment/terminator-relative-position-m</use>
|
||||||
|
</terminator>
|
||||||
|
<fogtype>
|
||||||
|
<use>/sim/rendering/shaders/skydome</use>
|
||||||
|
</fogtype>
|
||||||
|
<!-- END fog include -->
|
||||||
|
|
||||||
</parameters>
|
</parameters>
|
||||||
<generate>
|
<generate>
|
||||||
|
@ -128,8 +148,10 @@
|
||||||
</internal-format>
|
</internal-format>
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader>Shaders/forest.vert</vertex-shader>
|
<vertex-shader n="0">Shaders/include_fog.vert</vertex-shader>
|
||||||
<fragment-shader>Shaders/forest.frag</fragment-shader>
|
<vertex-shader n="1">Shaders/forest.vert</vertex-shader>
|
||||||
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||||
|
<fragment-shader n="1">Shaders/forest.frag</fragment-shader>
|
||||||
<attribute>
|
<attribute>
|
||||||
<name>tangent</name>
|
<name>tangent</name>
|
||||||
<index>6</index>
|
<index>6</index>
|
||||||
|
@ -199,6 +221,50 @@
|
||||||
<type>float</type>
|
<type>float</type>
|
||||||
<value>0.0</value>
|
<value>0.0</value>
|
||||||
</uniform>
|
</uniform>
|
||||||
|
<!-- BEGIN fog include -->
|
||||||
|
<uniform>
|
||||||
|
<name>visibility</name>
|
||||||
|
<type>float</type>
|
||||||
|
<value>
|
||||||
|
<use>visibility</use>
|
||||||
|
</value>
|
||||||
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>avisibility</name>
|
||||||
|
<type>float</type>
|
||||||
|
<value>
|
||||||
|
<use>avisibility</use>
|
||||||
|
</value>
|
||||||
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>hazeLayerAltitude</name>
|
||||||
|
<type>float</type>
|
||||||
|
<value>
|
||||||
|
<use>lthickness</use>
|
||||||
|
</value>
|
||||||
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>scattering</name>
|
||||||
|
<type>float</type>
|
||||||
|
<value>
|
||||||
|
<use>scattering</use>
|
||||||
|
</value>
|
||||||
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>terminator</name>
|
||||||
|
<type>float</type>
|
||||||
|
<value>
|
||||||
|
<use>terminator</use>
|
||||||
|
</value>
|
||||||
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>fogType</name>
|
||||||
|
<type>int</type>
|
||||||
|
<value>
|
||||||
|
<use>fogtype</use>
|
||||||
|
</value>
|
||||||
|
</uniform>
|
||||||
|
<!-- END fog include -->
|
||||||
</pass>
|
</pass>
|
||||||
</technique>
|
</technique>
|
||||||
</PropertyList>
|
</PropertyList>
|
||||||
|
|
|
@ -41,6 +41,27 @@
|
||||||
<season-blue type="float">0.22</season-blue>
|
<season-blue type="float">0.22</season-blue>
|
||||||
<!-- end season color -->
|
<!-- end season color -->
|
||||||
|
|
||||||
|
<!--fog include-->
|
||||||
|
<visibility>
|
||||||
|
<use>/environment/ground-visibility-m</use>
|
||||||
|
</visibility>
|
||||||
|
<avisibility>
|
||||||
|
<use>/environment/visibility-m</use>
|
||||||
|
</avisibility>
|
||||||
|
<lthickness>
|
||||||
|
<use>/environment/ground-haze-thickness-m</use>
|
||||||
|
</lthickness>
|
||||||
|
<scattering>
|
||||||
|
<use>/rendering/scene/scattering</use>
|
||||||
|
</scattering>
|
||||||
|
<terminator>
|
||||||
|
<use>/environment/terminator-relative-position-m</use>
|
||||||
|
</terminator>
|
||||||
|
<fogtype>
|
||||||
|
<use>/sim/rendering/shaders/skydome</use>
|
||||||
|
</fogtype>
|
||||||
|
<!-- END fog include -->
|
||||||
|
|
||||||
</parameters>
|
</parameters>
|
||||||
<generate>
|
<generate>
|
||||||
<tangent type="int">6</tangent>
|
<tangent type="int">6</tangent>
|
||||||
|
@ -128,8 +149,10 @@
|
||||||
</internal-format>
|
</internal-format>
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader>Shaders/forest.vert</vertex-shader>
|
<vertex-shader n="0">Shaders/include_fog.vert</vertex-shader>
|
||||||
<fragment-shader>Shaders/forest.frag</fragment-shader>
|
<vertex-shader n="1">Shaders/forest.vert</vertex-shader>
|
||||||
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||||
|
<fragment-shader n="1">Shaders/forest.frag</fragment-shader>
|
||||||
<attribute>
|
<attribute>
|
||||||
<name>tangent</name>
|
<name>tangent</name>
|
||||||
<index>6</index>
|
<index>6</index>
|
||||||
|
@ -199,6 +222,50 @@
|
||||||
<type>float</type>
|
<type>float</type>
|
||||||
<value>0.0</value>
|
<value>0.0</value>
|
||||||
</uniform>
|
</uniform>
|
||||||
|
<!-- BEGIN fog include -->
|
||||||
|
<uniform>
|
||||||
|
<name>visibility</name>
|
||||||
|
<type>float</type>
|
||||||
|
<value>
|
||||||
|
<use>visibility</use>
|
||||||
|
</value>
|
||||||
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>avisibility</name>
|
||||||
|
<type>float</type>
|
||||||
|
<value>
|
||||||
|
<use>avisibility</use>
|
||||||
|
</value>
|
||||||
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>hazeLayerAltitude</name>
|
||||||
|
<type>float</type>
|
||||||
|
<value>
|
||||||
|
<use>lthickness</use>
|
||||||
|
</value>
|
||||||
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>scattering</name>
|
||||||
|
<type>float</type>
|
||||||
|
<value>
|
||||||
|
<use>scattering</use>
|
||||||
|
</value>
|
||||||
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>terminator</name>
|
||||||
|
<type>float</type>
|
||||||
|
<value>
|
||||||
|
<use>terminator</use>
|
||||||
|
</value>
|
||||||
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>fogType</name>
|
||||||
|
<type>int</type>
|
||||||
|
<value>
|
||||||
|
<use>fogtype</use>
|
||||||
|
</value>
|
||||||
|
</uniform>
|
||||||
|
<!-- END fog include -->
|
||||||
</pass>
|
</pass>
|
||||||
</technique>
|
</technique>
|
||||||
</PropertyList>
|
</PropertyList>
|
||||||
|
|
|
@ -40,6 +40,27 @@
|
||||||
<season-blue type="float">0.22</season-blue>
|
<season-blue type="float">0.22</season-blue>
|
||||||
<!-- end season color -->
|
<!-- end season color -->
|
||||||
|
|
||||||
|
<!--fog include-->
|
||||||
|
<visibility>
|
||||||
|
<use>/environment/ground-visibility-m</use>
|
||||||
|
</visibility>
|
||||||
|
<avisibility>
|
||||||
|
<use>/environment/visibility-m</use>
|
||||||
|
</avisibility>
|
||||||
|
<lthickness>
|
||||||
|
<use>/environment/ground-haze-thickness-m</use>
|
||||||
|
</lthickness>
|
||||||
|
<scattering>
|
||||||
|
<use>/rendering/scene/scattering</use>
|
||||||
|
</scattering>
|
||||||
|
<terminator>
|
||||||
|
<use>/environment/terminator-relative-position-m</use>
|
||||||
|
</terminator>
|
||||||
|
<fogtype>
|
||||||
|
<use>/sim/rendering/shaders/skydome</use>
|
||||||
|
</fogtype>
|
||||||
|
<!-- END fog include -->
|
||||||
|
|
||||||
<quality-level><use>/sim/rendering/shaders/transition</use></quality-level>
|
<quality-level><use>/sim/rendering/shaders/transition</use></quality-level>
|
||||||
</parameters>
|
</parameters>
|
||||||
<generate>
|
<generate>
|
||||||
|
@ -128,8 +149,10 @@
|
||||||
</internal-format>
|
</internal-format>
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader>Shaders/forest.vert</vertex-shader>
|
<vertex-shader n="0">Shaders/include_fog.vert</vertex-shader>
|
||||||
<fragment-shader>Shaders/forest.frag</fragment-shader>
|
<vertex-shader n="1">Shaders/forest.vert</vertex-shader>
|
||||||
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||||
|
<fragment-shader n="1">Shaders/forest.frag</fragment-shader>
|
||||||
<attribute>
|
<attribute>
|
||||||
<name>tangent</name>
|
<name>tangent</name>
|
||||||
<index>6</index>
|
<index>6</index>
|
||||||
|
@ -199,6 +222,50 @@
|
||||||
<type>float</type>
|
<type>float</type>
|
||||||
<value>0.0</value>
|
<value>0.0</value>
|
||||||
</uniform>
|
</uniform>
|
||||||
|
<!-- BEGIN fog include -->
|
||||||
|
<uniform>
|
||||||
|
<name>visibility</name>
|
||||||
|
<type>float</type>
|
||||||
|
<value>
|
||||||
|
<use>visibility</use>
|
||||||
|
</value>
|
||||||
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>avisibility</name>
|
||||||
|
<type>float</type>
|
||||||
|
<value>
|
||||||
|
<use>avisibility</use>
|
||||||
|
</value>
|
||||||
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>hazeLayerAltitude</name>
|
||||||
|
<type>float</type>
|
||||||
|
<value>
|
||||||
|
<use>lthickness</use>
|
||||||
|
</value>
|
||||||
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>scattering</name>
|
||||||
|
<type>float</type>
|
||||||
|
<value>
|
||||||
|
<use>scattering</use>
|
||||||
|
</value>
|
||||||
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>terminator</name>
|
||||||
|
<type>float</type>
|
||||||
|
<value>
|
||||||
|
<use>terminator</use>
|
||||||
|
</value>
|
||||||
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>fogType</name>
|
||||||
|
<type>int</type>
|
||||||
|
<value>
|
||||||
|
<use>fogtype</use>
|
||||||
|
</value>
|
||||||
|
</uniform>
|
||||||
|
<!-- END fog include -->
|
||||||
</pass>
|
</pass>
|
||||||
</technique>
|
</technique>
|
||||||
</PropertyList>
|
</PropertyList>
|
||||||
|
|
|
@ -22,6 +22,12 @@ uniform float snowlevel; // From /sim/rendering/snow-level-m
|
||||||
const float scale = 1.0;
|
const float scale = 1.0;
|
||||||
int linear_search_steps = 10;
|
int linear_search_steps = 10;
|
||||||
|
|
||||||
|
////fog "include" /////
|
||||||
|
uniform int fogType;
|
||||||
|
|
||||||
|
vec3 fog_Func(vec3 color, int type);
|
||||||
|
//////////////////////
|
||||||
|
|
||||||
float ray_intersect(sampler2D reliefMap, vec2 dp, vec2 ds)
|
float ray_intersect(sampler2D reliefMap, vec2 dp, vec2 ds)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -182,8 +188,6 @@ void main (void)
|
||||||
c1 *= ambient_light;
|
c1 *= ambient_light;
|
||||||
vec4 finalColor = c1;
|
vec4 finalColor = c1;
|
||||||
|
|
||||||
if(gl_Fog.density == 1.0)
|
finalColor.rgb = fog_Func(finalColor.rgb, fogType);
|
||||||
fogFactor=1.0;
|
gl_FragColor = finalColor;
|
||||||
|
|
||||||
gl_FragColor = mix(gl_Fog.color,finalColor, fogFactor);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#version 120
|
||||||
varying vec4 rawpos;
|
varying vec4 rawpos;
|
||||||
varying vec4 ecPosition;
|
varying vec4 ecPosition;
|
||||||
varying vec3 VNormal;
|
varying vec3 VNormal;
|
||||||
|
@ -9,6 +10,12 @@ varying vec4 constantColor;
|
||||||
attribute vec3 tangent;
|
attribute vec3 tangent;
|
||||||
attribute vec3 binormal;
|
attribute vec3 binormal;
|
||||||
|
|
||||||
|
////fog "include"////////
|
||||||
|
uniform int fogType;
|
||||||
|
|
||||||
|
void fog_Func(int type);
|
||||||
|
/////////////////////////
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
rawpos = gl_Vertex;
|
rawpos = gl_Vertex;
|
||||||
|
@ -23,4 +30,5 @@ void main(void)
|
||||||
+ gl_FrontColor * (gl_LightModel.ambient + gl_LightSource[0].ambient);
|
+ gl_FrontColor * (gl_LightModel.ambient + gl_LightSource[0].ambient);
|
||||||
gl_Position = ftransform();
|
gl_Position = ftransform();
|
||||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||||
|
fog_Func(fogType);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue