Merge branch 'master' of git://gitorious.org/fg/fgdata
This commit is contained in:
commit
ac8daf42ee
56 changed files with 643 additions and 225 deletions
|
@ -316,7 +316,7 @@
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
|
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader>Shaders/include_fog.vert</vertex-shader>
|
<!-- <vertex-shader>Shaders/include_fog.vert</vertex-shader> -->
|
||||||
<vertex-shader>Shaders/wake.vert</vertex-shader>
|
<vertex-shader>Shaders/wake.vert</vertex-shader>
|
||||||
<fragment-shader>Shaders/include_fog.frag</fragment-shader>
|
<fragment-shader>Shaders/include_fog.frag</fragment-shader>
|
||||||
<fragment-shader>Shaders/bowwave.frag</fragment-shader>
|
<fragment-shader>Shaders/bowwave.frag</fragment-shader>
|
||||||
|
@ -445,7 +445,7 @@
|
||||||
<type>sampler-3d</type>
|
<type>sampler-3d</type>
|
||||||
<value type="int">1</value>
|
<value type="int">1</value>
|
||||||
</uniform>
|
</uniform>
|
||||||
|
|
||||||
<!-- BEGIN fog include -->
|
<!-- BEGIN fog include -->
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>visibility</name>
|
<name>visibility</name>
|
||||||
|
|
|
@ -80,8 +80,9 @@
|
||||||
</internal-format>
|
</internal-format>
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader>Shaders/crop.vert</vertex-shader>
|
<vertex-shader n="1">Shaders/crop.vert</vertex-shader>
|
||||||
<fragment-shader>Shaders/crop.frag</fragment-shader>
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||||
|
<fragment-shader n="1">Shaders/crop.frag</fragment-shader>
|
||||||
</program>
|
</program>
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>NoiseTex</name>
|
<name>NoiseTex</name>
|
||||||
|
|
|
@ -146,10 +146,10 @@
|
||||||
<use>vertex-program-two-side</use>
|
<use>vertex-program-two-side</use>
|
||||||
</vertex-program-two-side>
|
</vertex-program-two-side>
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader>Shaders/include_fog.vert</vertex-shader>
|
<!-- <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader> -->
|
||||||
<vertex-shader>Shaders/flutter.vert</vertex-shader>
|
<vertex-shader n="1">Shaders/flutter.vert</vertex-shader>
|
||||||
<fragment-shader>Shaders/include_fog.frag</fragment-shader>
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||||
<fragment-shader>Shaders/default.frag</fragment-shader>
|
<fragment-shader n="1">Shaders/default.frag</fragment-shader>
|
||||||
</program>
|
</program>
|
||||||
<!--<uniform>
|
<!--<uniform>
|
||||||
<name>texture</name>
|
<name>texture</name>
|
||||||
|
@ -217,7 +217,7 @@
|
||||||
<use>heading-deg</use>
|
<use>heading-deg</use>
|
||||||
</value>
|
</value>
|
||||||
</uniform>
|
</uniform>
|
||||||
|
|
||||||
<!-- BEGIN fog include -->
|
<!-- BEGIN fog include -->
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>visibility</name>
|
<name>visibility</name>
|
||||||
|
|
|
@ -148,7 +148,7 @@
|
||||||
</internal-format>
|
</internal-format>
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader n="0">Shaders/include_fog.vert</vertex-shader>
|
<!-- <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader> -->
|
||||||
<vertex-shader n="1">Shaders/forest.vert</vertex-shader>
|
<vertex-shader n="1">Shaders/forest.vert</vertex-shader>
|
||||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||||
<fragment-shader n="1">Shaders/forest.frag</fragment-shader>
|
<fragment-shader n="1">Shaders/forest.frag</fragment-shader>
|
||||||
|
|
|
@ -149,7 +149,7 @@
|
||||||
</internal-format>
|
</internal-format>
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader n="0">Shaders/include_fog.vert</vertex-shader>
|
<!-- <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader> -->
|
||||||
<vertex-shader n="1">Shaders/forest.vert</vertex-shader>
|
<vertex-shader n="1">Shaders/forest.vert</vertex-shader>
|
||||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||||
<fragment-shader n="1">Shaders/forest.frag</fragment-shader>
|
<fragment-shader n="1">Shaders/forest.frag</fragment-shader>
|
||||||
|
|
|
@ -149,7 +149,7 @@
|
||||||
</internal-format>
|
</internal-format>
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader n="0">Shaders/include_fog.vert</vertex-shader>
|
<!-- <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader> -->
|
||||||
<vertex-shader n="1">Shaders/forest.vert</vertex-shader>
|
<vertex-shader n="1">Shaders/forest.vert</vertex-shader>
|
||||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||||
<fragment-shader n="1">Shaders/forest.frag</fragment-shader>
|
<fragment-shader n="1">Shaders/forest.frag</fragment-shader>
|
||||||
|
|
|
@ -110,7 +110,7 @@
|
||||||
</internal-format>
|
</internal-format>
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader n="0">Shaders/include_fog.vert</vertex-shader>
|
<!-- <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader> -->
|
||||||
<vertex-shader n="1">Shaders/landmass-g.vert</vertex-shader>
|
<vertex-shader n="1">Shaders/landmass-g.vert</vertex-shader>
|
||||||
<geometry-shader>Shaders/landmass.geom</geometry-shader>
|
<geometry-shader>Shaders/landmass.geom</geometry-shader>
|
||||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||||
|
@ -140,7 +140,7 @@
|
||||||
</value>
|
</value>
|
||||||
</uniform>
|
</uniform>
|
||||||
<color-mask type="vec4d">0 0 0 0</color-mask>
|
<color-mask type="vec4d">0 0 0 0</color-mask>
|
||||||
|
|
||||||
<!-- BEGIN fog include -->
|
<!-- BEGIN fog include -->
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>visibility</name>
|
<name>visibility</name>
|
||||||
|
@ -185,7 +185,7 @@
|
||||||
</value>
|
</value>
|
||||||
</uniform>
|
</uniform>
|
||||||
<!-- END fog include -->
|
<!-- END fog include -->
|
||||||
|
|
||||||
</pass>
|
</pass>
|
||||||
<pass>
|
<pass>
|
||||||
<lighting>true</lighting>
|
<lighting>true</lighting>
|
||||||
|
|
|
@ -11,6 +11,26 @@
|
||||||
</material>
|
</material>
|
||||||
<condition><use>/sim/rendering/shader/generic</use></condition>
|
<condition><use>/sim/rendering/shader/generic</use></condition>
|
||||||
<factor>1</factor>
|
<factor>1</factor>
|
||||||
|
<!-- BEGIN 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>
|
||||||
<technique n="10">
|
<technique n="10">
|
||||||
<predicate>
|
<predicate>
|
||||||
|
@ -83,7 +103,8 @@
|
||||||
</vertex-program-two-side>
|
</vertex-program-two-side>
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader>Shaders/lightmap.vert</vertex-shader>
|
<vertex-shader>Shaders/lightmap.vert</vertex-shader>
|
||||||
<fragment-shader>Shaders/lightmap.frag</fragment-shader>
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||||
|
<fragment-shader n="1">Shaders/lightmap.frag</fragment-shader>
|
||||||
</program>
|
</program>
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>texture</name>
|
<name>texture</name>
|
||||||
|
@ -110,6 +131,50 @@
|
||||||
<type>float</type>
|
<type>float</type>
|
||||||
<value><use>factor</use></value>
|
<value><use>factor</use></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>
|
||||||
<technique n="11">
|
<technique n="11">
|
||||||
|
|
|
@ -366,7 +366,7 @@ please see Docs/README.model-combined.eff for documentation
|
||||||
</vertex-program-two-side>
|
</vertex-program-two-side>
|
||||||
|
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader n="0">Shaders/include_fog.vert</vertex-shader>
|
<!-- <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader> -->
|
||||||
<vertex-shader n="1">Shaders/ubershader.vert</vertex-shader>
|
<vertex-shader n="1">Shaders/ubershader.vert</vertex-shader>
|
||||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||||
<fragment-shader n="1">Shaders/ubershader.frag</fragment-shader>
|
<fragment-shader n="1">Shaders/ubershader.frag</fragment-shader>
|
||||||
|
@ -391,7 +391,7 @@ please see Docs/README.model-combined.eff for documentation
|
||||||
<type>sampler-3d</type>
|
<type>sampler-3d</type>
|
||||||
<value type="int">1</value>
|
<value type="int">1</value>
|
||||||
</uniform>
|
</uniform>
|
||||||
|
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>NormalTex</name>
|
<name>NormalTex</name>
|
||||||
<type>sampler-2d</type>
|
<type>sampler-2d</type>
|
||||||
|
|
|
@ -126,7 +126,7 @@
|
||||||
<use>vertex-program-two-side</use>
|
<use>vertex-program-two-side</use>
|
||||||
</vertex-program-two-side>
|
</vertex-program-two-side>
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader n="0">Shaders/include_fog.vert</vertex-shader>
|
<!-- <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader> -->
|
||||||
<!--fog include-->
|
<!--fog include-->
|
||||||
<vertex-shader n="1">Shaders/default.vert</vertex-shader>
|
<vertex-shader n="1">Shaders/default.vert</vertex-shader>
|
||||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||||
|
|
|
@ -215,7 +215,7 @@ EXAMPLES: You can find examples of both usages in the Hunter and Lightning model
|
||||||
<use>texture[0]/internal-format</use>
|
<use>texture[0]/internal-format</use>
|
||||||
</internal-format>
|
</internal-format>
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
|
|
||||||
<texture-unit>
|
<texture-unit>
|
||||||
<unit>1</unit>
|
<unit>1</unit>
|
||||||
<image>
|
<image>
|
||||||
|
@ -314,10 +314,10 @@ EXAMPLES: You can find examples of both usages in the Hunter and Lightning model
|
||||||
|
|
||||||
|
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader>Shaders/include_fog.vert</vertex-shader>
|
<!-- <vertex-shader>Shaders/include_fog.vert</vertex-shader> -->
|
||||||
<vertex-shader>Shaders/reflect-bump-spec.vert</vertex-shader>
|
<vertex-shader n="1">Shaders/reflect-bump-spec.vert</vertex-shader>
|
||||||
<fragment-shader>Shaders/include_fog.frag</fragment-shader>
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||||
<fragment-shader>Shaders/reflect-bump-spec.frag</fragment-shader>
|
<fragment-shader n="1">Shaders/reflect-bump-spec.frag</fragment-shader>
|
||||||
<attribute>
|
<attribute>
|
||||||
<name>tangent</name>
|
<name>tangent</name>
|
||||||
<index>6</index>
|
<index>6</index>
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
To use a reflection map set <reflect_map> to 1,and the path to the map texture in
|
To use a reflection map set <reflect_map> to 1,and the path to the map texture in
|
||||||
<texture n="8">
|
<texture n="8">
|
||||||
|
|
||||||
To use a light map set <light_map> to 1,and the path to the map texture in
|
To use a light map set <light_map> to 1,and the path to the map texture in
|
||||||
<texture n="2">
|
<texture n="2">
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@
|
||||||
<use>texture[8]/internal-format</use>
|
<use>texture[8]/internal-format</use>
|
||||||
</internal-format>
|
</internal-format>
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
|
|
||||||
<texture-unit>
|
<texture-unit>
|
||||||
<unit>2</unit>
|
<unit>2</unit>
|
||||||
<type>
|
<type>
|
||||||
|
@ -226,12 +226,12 @@
|
||||||
<wrap-s>repeat</wrap-s>
|
<wrap-s>repeat</wrap-s>
|
||||||
<wrap-t>repeat</wrap-t>
|
<wrap-t>repeat</wrap-t>
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
|
|
||||||
<texture-unit>
|
<texture-unit>
|
||||||
<unit>3</unit>
|
<unit>3</unit>
|
||||||
<type>noise</type>
|
<type>noise</type>
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
|
|
||||||
<texture-unit>
|
<texture-unit>
|
||||||
<unit>5</unit>
|
<unit>5</unit>
|
||||||
<type>
|
<type>
|
||||||
|
@ -288,7 +288,7 @@
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
|
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader n="0">Shaders/include_fog.vert</vertex-shader>
|
<!-- <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader> -->
|
||||||
<vertex-shader n="1">Shaders/reflect.vert</vertex-shader>
|
<vertex-shader n="1">Shaders/reflect.vert</vertex-shader>
|
||||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||||
<fragment-shader n="1">Shaders/reflect.frag</fragment-shader>
|
<fragment-shader n="1">Shaders/reflect.frag</fragment-shader>
|
||||||
|
@ -317,7 +317,7 @@
|
||||||
<type>sampler-2d</type>
|
<type>sampler-2d</type>
|
||||||
<value type="int">1</value>
|
<value type="int">1</value>
|
||||||
</uniform>
|
</uniform>
|
||||||
|
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>Lightmap</name>
|
<name>Lightmap</name>
|
||||||
<type>sampler-2d</type>
|
<type>sampler-2d</type>
|
||||||
|
@ -329,7 +329,7 @@
|
||||||
<type>sampler-3d</type>
|
<type>sampler-3d</type>
|
||||||
<value type="int">3</value>
|
<value type="int">3</value>
|
||||||
</uniform>
|
</uniform>
|
||||||
|
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>Environment</name>
|
<name>Environment</name>
|
||||||
<type>sampler-cube</type>
|
<type>sampler-cube</type>
|
||||||
|
@ -402,7 +402,7 @@
|
||||||
<use>reflect_map</use>
|
<use>reflect_map</use>
|
||||||
</value>
|
</value>
|
||||||
</uniform>
|
</uniform>
|
||||||
|
|
||||||
<!-- use a light map-->
|
<!-- use a light map-->
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>light_map</name>
|
<name>light_map</name>
|
||||||
|
|
|
@ -123,7 +123,7 @@
|
||||||
<use>texture[1]/internal-format</use>
|
<use>texture[1]/internal-format</use>
|
||||||
</internal-format>
|
</internal-format>
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
|
|
||||||
<texture-unit>
|
<texture-unit>
|
||||||
<unit>1</unit>
|
<unit>1</unit>
|
||||||
<image>
|
<image>
|
||||||
|
@ -147,7 +147,7 @@
|
||||||
<unit>2</unit>
|
<unit>2</unit>
|
||||||
<type>noise</type>
|
<type>noise</type>
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
|
|
||||||
<texture-unit>
|
<texture-unit>
|
||||||
<unit>4</unit>
|
<unit>4</unit>
|
||||||
<image>
|
<image>
|
||||||
|
@ -230,7 +230,7 @@
|
||||||
</cull-face>
|
</cull-face>
|
||||||
|
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader n="0">Shaders/include_fog.vert</vertex-shader>
|
<!-- <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader> -->
|
||||||
<vertex-shader n="1">Shaders/reflect-bump-spec.vert</vertex-shader>
|
<vertex-shader n="1">Shaders/reflect-bump-spec.vert</vertex-shader>
|
||||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||||
<fragment-shader n="1">Shaders/runway-reflect-bump-spec.frag</fragment-shader>
|
<fragment-shader n="1">Shaders/runway-reflect-bump-spec.frag</fragment-shader>
|
||||||
|
@ -261,7 +261,7 @@
|
||||||
<type>sampler-3d</type>
|
<type>sampler-3d</type>
|
||||||
<value type="int">2</value>
|
<value type="int">2</value>
|
||||||
</uniform>
|
</uniform>
|
||||||
|
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>NormalTex</name>
|
<name>NormalTex</name>
|
||||||
<type>sampler-2d</type>
|
<type>sampler-2d</type>
|
||||||
|
|
|
@ -123,7 +123,7 @@
|
||||||
</internal-format>
|
</internal-format>
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader n="0">Shaders/include_fog.vert</vertex-shader>
|
<!-- <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader> -->
|
||||||
<vertex-shader n="1">Shaders/default.vert</vertex-shader>
|
<vertex-shader n="1">Shaders/default.vert</vertex-shader>
|
||||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||||
<fragment-shader n="1">Shaders/terrain-nocolor.frag</fragment-shader>
|
<fragment-shader n="1">Shaders/terrain-nocolor.frag</fragment-shader>
|
||||||
|
|
|
@ -229,10 +229,10 @@ parameters :
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
|
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader>Shaders/include_fog.vert</vertex-shader>
|
<!-- <vertex-shader>Shaders/include_fog.vert</vertex-shader> -->
|
||||||
<vertex-shader>Shaders/transition.vert</vertex-shader>
|
<vertex-shader n="1">Shaders/transition.vert</vertex-shader>
|
||||||
<fragment-shader>Shaders/include_fog.frag</fragment-shader>
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||||
<fragment-shader>Shaders/transition.frag</fragment-shader>
|
<fragment-shader n="1">Shaders/transition.frag</fragment-shader>
|
||||||
</program>
|
</program>
|
||||||
|
|
||||||
<uniform>
|
<uniform>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<use>/sim/rendering/shaders/urban</use>
|
<use>/sim/rendering/shaders/urban</use>
|
||||||
</quality-level>
|
</quality-level>
|
||||||
|
|
||||||
<!--fog include-->
|
<!--fog include-->
|
||||||
<visibility>
|
<visibility>
|
||||||
<use>/environment/ground-visibility-m</use>
|
<use>/environment/ground-visibility-m</use>
|
||||||
</visibility>
|
</visibility>
|
||||||
|
@ -159,7 +159,7 @@
|
||||||
<type>noise</type>
|
<type>noise</type>
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader n="0">Shaders/include_fog.vert</vertex-shader>
|
<!-- <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader> -->
|
||||||
<vertex-shader n="1">Shaders/urban.vert</vertex-shader>
|
<vertex-shader n="1">Shaders/urban.vert</vertex-shader>
|
||||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||||
<fragment-shader n="1">Shaders/urban.frag</fragment-shader>
|
<fragment-shader n="1">Shaders/urban.frag</fragment-shader>
|
||||||
|
@ -489,7 +489,7 @@
|
||||||
<use>snow-level</use>
|
<use>snow-level</use>
|
||||||
</value>
|
</value>
|
||||||
</uniform>
|
</uniform>
|
||||||
|
|
||||||
|
|
||||||
</pass>
|
</pass>
|
||||||
</technique>
|
</technique>
|
||||||
|
|
|
@ -195,10 +195,12 @@
|
||||||
</internal-format>
|
</internal-format>
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader>Shaders/include_fog.vert</vertex-shader>
|
<!-- <vertex-shader>Shaders/include_fog.vert</vertex-shader> -->
|
||||||
<vertex-shader>Shaders/water.vert</vertex-shader>
|
<vertex-shader>Shaders/water.vert</vertex-shader>
|
||||||
|
<fragment-shader>Shaders/include_fog.frag</fragment-shader>
|
||||||
<fragment-shader>Shaders/water-inland.frag</fragment-shader>
|
<fragment-shader>Shaders/water-inland.frag</fragment-shader>
|
||||||
</program>
|
</program>
|
||||||
|
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>water_reflection</name>
|
<name>water_reflection</name>
|
||||||
<type>sampler-2d</type>
|
<type>sampler-2d</type>
|
||||||
|
@ -360,6 +362,7 @@
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader>Shaders/water-orig.vert</vertex-shader>
|
<vertex-shader>Shaders/water-orig.vert</vertex-shader>
|
||||||
|
<fragment-shader>Shaders/include_fog.frag</fragment-shader>
|
||||||
<fragment-shader>Shaders/water-orig.frag</fragment-shader>
|
<fragment-shader>Shaders/water-orig.frag</fragment-shader>
|
||||||
</program>
|
</program>
|
||||||
<uniform>
|
<uniform>
|
||||||
|
@ -367,6 +370,50 @@
|
||||||
<type>sampler-3d</type>
|
<type>sampler-3d</type>
|
||||||
<value type="int">0</value>
|
<value type="int">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>
|
||||||
|
|
|
@ -292,7 +292,7 @@
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
|
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader>Shaders/include_fog.vert</vertex-shader>
|
<!-- <vertex-shader>Shaders/include_fog.vert</vertex-shader> -->
|
||||||
<vertex-shader>Shaders/water.vert</vertex-shader>
|
<vertex-shader>Shaders/water.vert</vertex-shader>
|
||||||
<fragment-shader>Shaders/include_fog.frag</fragment-shader>
|
<fragment-shader>Shaders/include_fog.frag</fragment-shader>
|
||||||
<fragment-shader>Shaders/water_sine.frag</fragment-shader>
|
<fragment-shader>Shaders/water_sine.frag</fragment-shader>
|
||||||
|
@ -449,7 +449,7 @@
|
||||||
</uniform>
|
</uniform>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- BEGIN fog include -->
|
<!-- BEGIN fog include -->
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>visibility</name>
|
<name>visibility</name>
|
||||||
|
@ -658,7 +658,7 @@
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
|
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader>Shaders/include_fog.vert</vertex-shader>
|
<!-- <vertex-shader>Shaders/include_fog.vert</vertex-shader> -->
|
||||||
<vertex-shader>Shaders/water.vert</vertex-shader>
|
<vertex-shader>Shaders/water.vert</vertex-shader>
|
||||||
<fragment-shader>Shaders/include_fog.frag</fragment-shader>
|
<fragment-shader>Shaders/include_fog.frag</fragment-shader>
|
||||||
<fragment-shader>Shaders/water.frag</fragment-shader>
|
<fragment-shader>Shaders/water.frag</fragment-shader>
|
||||||
|
|
217
Input/Joysticks/InterLink/interlink-elite.xml
Normal file
217
Input/Joysticks/InterLink/interlink-elite.xml
Normal file
|
@ -0,0 +1,217 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
************************************************************************
|
||||||
|
InterLink Elite Controller Bindings
|
||||||
|
5 axis (2 joy, 1 rotary)
|
||||||
|
4 button (1 three-position, 2 two-position, 1 momentary)
|
||||||
|
|
||||||
|
Author: e-pilot - License - none - freely distributable and modifiable
|
||||||
|
Version 0.1 - tested on Windows fgfs 2.4.0 only - Linux testing and mods (if needed) soon
|
||||||
|
|
||||||
|
The Interlink Elite controller (by Futaba) is a component of
|
||||||
|
RealFlight R/C Flight Simulator and connects through a USB port.
|
||||||
|
|
||||||
|
Controls:
|
||||||
|
|
||||||
|
Left Joystick up-down: Throttle
|
||||||
|
Left Joystick left-right: Rudder
|
||||||
|
Right Joystick up-down: Elevator
|
||||||
|
Right Joystick left-right: Aileron
|
||||||
|
|
||||||
|
Three Position switch at upper left of controller:
|
||||||
|
up: Elev trim up
|
||||||
|
down: Elev trim down
|
||||||
|
return to center: Stop trim adjustment
|
||||||
|
|
||||||
|
Two position switch above left joystick:
|
||||||
|
forward (push): Gear Down
|
||||||
|
back (pull): Gear Up
|
||||||
|
|
||||||
|
Two position switch above right joystick:
|
||||||
|
forward (push): Apply All Brakes
|
||||||
|
back (pull): Release All Brakes
|
||||||
|
|
||||||
|
Rotary knob above right joystick:
|
||||||
|
Rotate clockwise: Lower Flaps
|
||||||
|
Rotate counterclockwise: Raise Flaps
|
||||||
|
Return to center: Stop flap adjustment
|
||||||
|
|
||||||
|
(Note: if flaps are adjustable in 3 increments, to obtain full
|
||||||
|
flaps, rotate knob clockwise and return to center three times)
|
||||||
|
|
||||||
|
Red Reset Button: Reset View
|
||||||
|
|
||||||
|
************************************************************************
|
||||||
|
$Id$
|
||||||
|
-->
|
||||||
|
|
||||||
|
<PropertyList>
|
||||||
|
|
||||||
|
<name>InterLink Elite</name>
|
||||||
|
|
||||||
|
<axis n="0">
|
||||||
|
<desc>Aileron</desc>
|
||||||
|
<binding>
|
||||||
|
<command>property-scale</command>
|
||||||
|
<property>/controls/flight/aileron</property>
|
||||||
|
<factor type="double">3.0</factor>
|
||||||
|
<squared type="bool">true</squared>
|
||||||
|
</binding>
|
||||||
|
</axis>
|
||||||
|
|
||||||
|
<axis n="1">
|
||||||
|
<desc>Elevator</desc>
|
||||||
|
<binding>
|
||||||
|
<command>property-scale</command>
|
||||||
|
<property>/controls/flight/elevator</property>
|
||||||
|
<factor type="double">-3.5</factor>
|
||||||
|
<squared type="bool">true</squared>
|
||||||
|
</binding>
|
||||||
|
</axis>
|
||||||
|
|
||||||
|
<axis n="2">
|
||||||
|
<desc>Throttle</desc>
|
||||||
|
<binding>
|
||||||
|
<command>property-scale</command>
|
||||||
|
<property>/controls/engines/engine[0]/throttle</property>
|
||||||
|
<offset type="double">-0.55</offset>
|
||||||
|
<factor type="double">-1.0</factor>
|
||||||
|
</binding>
|
||||||
|
<binding>
|
||||||
|
<command>property-scale</command>
|
||||||
|
<property>/controls/engines/engine[1]/throttle</property>
|
||||||
|
<offset type="double">-0.55</offset>
|
||||||
|
<factor type="double">-1.0</factor>
|
||||||
|
</binding>
|
||||||
|
<binding>
|
||||||
|
<command>property-scale</command>
|
||||||
|
<property>/controls/engines/engine[2]/throttle</property>
|
||||||
|
<offset type="double">-0.55</offset>
|
||||||
|
<factor type="double">-1.0</factor>
|
||||||
|
</binding>
|
||||||
|
<binding>
|
||||||
|
<command>property-scale</command>
|
||||||
|
<property>/controls/engines/engine[3]/throttle</property>
|
||||||
|
<offset type="double">-0.55</offset>
|
||||||
|
<factor type="double">-1.0</factor>
|
||||||
|
</binding>
|
||||||
|
<binding>
|
||||||
|
<command>property-scale</command>
|
||||||
|
<property>/controls/engines/engine[4]/throttle</property>
|
||||||
|
<offset type="double">-0.55</offset>
|
||||||
|
<factor type="double">-1.0</factor>
|
||||||
|
</binding>
|
||||||
|
<binding>
|
||||||
|
<command>property-scale</command>
|
||||||
|
<property>/controls/engines/engine[5]/throttle</property>
|
||||||
|
<offset type="double">-0.55</offset>
|
||||||
|
<factor type="double">-1.0</factor>
|
||||||
|
</binding>
|
||||||
|
<binding>
|
||||||
|
<command>property-scale</command>
|
||||||
|
<property>/controls/engines/engine[6]/throttle</property>
|
||||||
|
<offset type="double">-0.55</offset>
|
||||||
|
<factor type="double">-1.0</factor>
|
||||||
|
</binding>
|
||||||
|
<binding>
|
||||||
|
<command>property-scale</command>
|
||||||
|
<property>/controls/engines/engine[7]/throttle</property>
|
||||||
|
<offset type="double">-0.55</offset>
|
||||||
|
<factor type="double">-1.0</factor>
|
||||||
|
</binding>
|
||||||
|
<binding>
|
||||||
|
<command>property-scale</command>
|
||||||
|
<property>/controls/engines/engine[8]/throttle</property>
|
||||||
|
<offset type="double">-0.55</offset>
|
||||||
|
<factor type="double">-1.0</factor>
|
||||||
|
</binding>
|
||||||
|
</axis>
|
||||||
|
|
||||||
|
<axis n="3">
|
||||||
|
<desc>Rudder</desc>
|
||||||
|
<binding>
|
||||||
|
<command>property-scale</command>
|
||||||
|
<property>/controls/flight/rudder</property>
|
||||||
|
<factor type="double">3.0</factor>
|
||||||
|
<squared type="bool">true</squared>
|
||||||
|
</binding>
|
||||||
|
</axis>
|
||||||
|
|
||||||
|
<axis n="4">
|
||||||
|
<desc>Flap Control</desc>
|
||||||
|
<low>
|
||||||
|
<repeatable>false</repeatable>
|
||||||
|
<binding>
|
||||||
|
<command>nasal</command>
|
||||||
|
<script>controls.flapsDown(-1)</script>
|
||||||
|
</binding>
|
||||||
|
</low>
|
||||||
|
<high>
|
||||||
|
<repeatable>false</repeatable>
|
||||||
|
<binding>
|
||||||
|
<command>nasal</command>
|
||||||
|
<script>controls.flapsDown(1)</script>
|
||||||
|
</binding>
|
||||||
|
</high>
|
||||||
|
</axis>
|
||||||
|
|
||||||
|
<button n="0">
|
||||||
|
<desc>Gear Control</desc>
|
||||||
|
<binding>
|
||||||
|
<repeatable>false</repeatable>
|
||||||
|
<command>nasal</command>
|
||||||
|
<script>controls.gearDown(-1)</script>
|
||||||
|
</binding>
|
||||||
|
<mod-up>
|
||||||
|
<binding>
|
||||||
|
<repeatable>false</repeatable>
|
||||||
|
<command>nasal</command>
|
||||||
|
<script>controls.gearDown(1)</script>
|
||||||
|
</binding>
|
||||||
|
</mod-up>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button n="1">
|
||||||
|
<desc>Brakes</desc>
|
||||||
|
<binding>
|
||||||
|
<command>nasal</command>
|
||||||
|
<script>controls.applyBrakes(1)</script>
|
||||||
|
</binding>
|
||||||
|
<mod-up>
|
||||||
|
<binding>
|
||||||
|
<command>nasal</command>
|
||||||
|
<script>controls.applyBrakes(0)</script>
|
||||||
|
</binding>
|
||||||
|
</mod-up>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button n="2">
|
||||||
|
<desc>Reset View</desc>
|
||||||
|
<binding>
|
||||||
|
<command>nasal</command>
|
||||||
|
<script>view.resetView()</script>
|
||||||
|
</binding>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button n="3">
|
||||||
|
<desc>Elevator trim up</desc>
|
||||||
|
<repeatable type="bool">true</repeatable>
|
||||||
|
<binding>
|
||||||
|
<command>nasal</command>
|
||||||
|
<script>controls.elevatorTrim(1)</script>
|
||||||
|
</binding>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button n="4">
|
||||||
|
<desc>Elevator trim down</desc>
|
||||||
|
<repeatable type="bool">true</repeatable>
|
||||||
|
<binding>
|
||||||
|
<command>nasal</command>
|
||||||
|
<script>controls.elevatorTrim(-1)</script>
|
||||||
|
</binding>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</PropertyList>
|
||||||
|
|
||||||
|
<!-- end of InterLinkElite.xml -->
|
|
@ -2,7 +2,7 @@
|
||||||
// Licence: GPL v2
|
// Licence: GPL v2
|
||||||
// Author: Frederic Bouvier
|
// Author: Frederic Bouvier
|
||||||
|
|
||||||
varying float fogCoord;
|
//varying float fogCoord;
|
||||||
|
|
||||||
varying vec3 VNormal;
|
varying vec3 VNormal;
|
||||||
varying vec3 VTangent;
|
varying vec3 VTangent;
|
||||||
|
@ -11,7 +11,13 @@ varying vec3 VBinormal;
|
||||||
uniform sampler2D tex_color;
|
uniform sampler2D tex_color;
|
||||||
uniform sampler2D tex_normal;
|
uniform sampler2D tex_normal;
|
||||||
|
|
||||||
void main (void)
|
////fog "include" /////
|
||||||
|
uniform int fogType;
|
||||||
|
|
||||||
|
vec3 fog_Func(vec3 color, int type);
|
||||||
|
//////////////////////
|
||||||
|
|
||||||
|
void main (void)
|
||||||
{
|
{
|
||||||
vec4 ns = texture2D(tex_normal, gl_TexCoord[0].st);
|
vec4 ns = texture2D(tex_normal, gl_TexCoord[0].st);
|
||||||
vec3 N = ns.rgb * 2.0 - 1.0;
|
vec3 N = ns.rgb * 2.0 - 1.0;
|
||||||
|
@ -36,11 +42,12 @@ void main (void)
|
||||||
color = clamp( color, 0.0, 1.0 );
|
color = clamp( color, 0.0, 1.0 );
|
||||||
|
|
||||||
|
|
||||||
float fogFactor;
|
// float fogFactor;
|
||||||
const float LOG2 = 1.442695;
|
// const float LOG2 = 1.442695;
|
||||||
fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
// fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
||||||
fogFactor = clamp(fogFactor, 0.0, 1.0);
|
// fogFactor = clamp(fogFactor, 0.0, 1.0);
|
||||||
|
// gl_FragColor = mix(gl_Fog.color, color, fogFactor);
|
||||||
|
|
||||||
|
color.rgb = fog_Func(fragColor.rgb, fogType);
|
||||||
gl_FragColor = mix(gl_Fog.color, color, fogFactor);
|
gl_FragColor = color;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// Licence: GPL v2
|
// Licence: GPL v2
|
||||||
// Author: Frederic Bouvier
|
// Author: Frederic Bouvier
|
||||||
|
|
||||||
varying float fogCoord;
|
//varying float fogCoord;
|
||||||
varying vec3 VNormal;
|
varying vec3 VNormal;
|
||||||
varying vec3 VTangent;
|
varying vec3 VTangent;
|
||||||
varying vec3 VBinormal;
|
varying vec3 VBinormal;
|
||||||
|
@ -12,8 +12,8 @@ attribute vec3 binormal;
|
||||||
|
|
||||||
void main (void)
|
void main (void)
|
||||||
{
|
{
|
||||||
vec4 pos = gl_ModelViewMatrix * gl_Vertex;
|
// vec4 pos = gl_ModelViewMatrix * gl_Vertex;
|
||||||
fogCoord = pos.z / pos.w;
|
// fogCoord = pos.z / pos.w;
|
||||||
|
|
||||||
VNormal = normalize(gl_NormalMatrix * gl_Normal);
|
VNormal = normalize(gl_NormalMatrix * gl_Normal);
|
||||||
VTangent = normalize(gl_NormalMatrix * tangent);
|
VTangent = normalize(gl_NormalMatrix * tangent);
|
||||||
|
|
|
@ -18,12 +18,18 @@ const float scale = 1.0;
|
||||||
#define BLA 1
|
#define BLA 1
|
||||||
#define BLA2 0
|
#define BLA2 0
|
||||||
|
|
||||||
|
////fog "include" /////
|
||||||
|
uniform int fogType;
|
||||||
|
|
||||||
|
vec3 fog_Func(vec3 color, int type);
|
||||||
|
//////////////////////
|
||||||
|
|
||||||
void main (void)
|
void main (void)
|
||||||
{
|
{
|
||||||
|
|
||||||
vec4 basecolor = texture2D(SampleTex, rawpos.xy*0.000144);
|
vec4 basecolor = texture2D(SampleTex, rawpos.xy*0.000144);
|
||||||
basecolor = texture1D(ColorsTex, basecolor.r+0.00);
|
basecolor = texture1D(ColorsTex, basecolor.r+0.00);
|
||||||
|
|
||||||
vec4 noisevec = texture3D(NoiseTex, (rawpos.xyz)*0.01*scale);
|
vec4 noisevec = texture3D(NoiseTex, (rawpos.xyz)*0.01*scale);
|
||||||
|
|
||||||
vec4 nvL = texture3D(NoiseTex, (rawpos.xyz)*0.00066*scale);
|
vec4 nvL = texture3D(NoiseTex, (rawpos.xyz)*0.00066*scale);
|
||||||
|
@ -51,10 +57,10 @@ void main (void)
|
||||||
// good
|
// good
|
||||||
vec4 c1;
|
vec4 c1;
|
||||||
c1 = basecolor * vec4(smoothstep(0.0, 1.15, n), smoothstep(0.0, 1.2, n), smoothstep(0.1, 1.3, n), 1.0);
|
c1 = basecolor * vec4(smoothstep(0.0, 1.15, n), smoothstep(0.0, 1.2, n), smoothstep(0.1, 1.3, n), 1.0);
|
||||||
|
|
||||||
//"steep = gray"
|
//"steep = gray"
|
||||||
c1 = mix(vec4(n-0.42, n-0.44, n-0.51, 1.0), c1, smoothstep(0.970, 0.990, abs(normalize(Normal).z)+nvL[2]*1.3));
|
c1 = mix(vec4(n-0.42, n-0.44, n-0.51, 1.0), c1, smoothstep(0.970, 0.990, abs(normalize(Normal).z)+nvL[2]*1.3));
|
||||||
|
|
||||||
//"snow"
|
//"snow"
|
||||||
c1 = mix(c1, clamp(n+nvL[2]*4.1+vec4(0.1, 0.1, nvL[2]*2.2, 1.0), 0.7, 1.0), smoothstep(snowlevel+300.0, snowlevel+360.0, (rawpos.z)+nvL[1]*3000.0));
|
c1 = mix(c1, clamp(n+nvL[2]*4.1+vec4(0.1, 0.1, nvL[2]*2.2, 1.0), 0.7, 1.0), smoothstep(snowlevel+300.0, snowlevel+360.0, (rawpos.z)+nvL[1]*3000.0));
|
||||||
|
|
||||||
|
@ -64,8 +70,10 @@ void main (void)
|
||||||
c1 *= ambient_light;
|
c1 *= ambient_light;
|
||||||
vec4 finalColor = c1;
|
vec4 finalColor = c1;
|
||||||
|
|
||||||
if(gl_Fog.density == 1.0)
|
// if(gl_Fog.density == 1.0)
|
||||||
fogFactor=1.0;
|
// fogFactor=1.0;
|
||||||
|
//
|
||||||
gl_FragColor = mix(gl_Fog.color ,finalColor, fogFactor);
|
// gl_FragColor = mix(gl_Fog.color ,finalColor, fogFactor);
|
||||||
|
finalColor.rgb = fog_Func(finalColor.rgb, fogType);
|
||||||
|
gl_FragColor = finalColor;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,9 +22,9 @@ varying vec3 normal;
|
||||||
uniform int colorMode;
|
uniform int colorMode;
|
||||||
|
|
||||||
////fog "include"////////
|
////fog "include"////////
|
||||||
uniform int fogType;
|
//uniform int fogType;
|
||||||
|
//
|
||||||
void fog_Func(int type);
|
//void fog_Func(int type);
|
||||||
/////////////////////////
|
/////////////////////////
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
|
@ -57,5 +57,5 @@ void main()
|
||||||
gl_FrontColor.rgb = constant_term.rgb; gl_FrontColor.a = 1.0;
|
gl_FrontColor.rgb = constant_term.rgb; gl_FrontColor.a = 1.0;
|
||||||
gl_BackColor.rgb = constant_term.rgb; gl_BackColor.a = 0.0;
|
gl_BackColor.rgb = constant_term.rgb; gl_BackColor.a = 0.0;
|
||||||
//fogCoord = abs(ecPosition.z / ecPosition.w);
|
//fogCoord = abs(ecPosition.z / ecPosition.w);
|
||||||
fog_Func(fogType);
|
//fog_Func(fogType);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,9 +30,9 @@ uniform float Offset, AmpFactor, WindE, WindN, spd, hdg;
|
||||||
uniform sampler3D Noise;
|
uniform sampler3D Noise;
|
||||||
|
|
||||||
////fog "include"////////
|
////fog "include"////////
|
||||||
uniform int fogType;
|
//uniform int fogType;
|
||||||
|
//
|
||||||
void fog_Func(int type);
|
//void fog_Func(int type);
|
||||||
/////////////////////////
|
/////////////////////////
|
||||||
|
|
||||||
/////// functions /////////
|
/////// functions /////////
|
||||||
|
@ -56,7 +56,7 @@ void relWind(out float rel_wind_speed_kts, out float rel_wind_from_rad)
|
||||||
float rel_wind_speed_from_north_kts = WindN*fps2kts + speed_north_kts;
|
float rel_wind_speed_from_north_kts = WindN*fps2kts + speed_north_kts;
|
||||||
|
|
||||||
//combine relative speeds north and east to get relative windspeed in kts
|
//combine relative speeds north and east to get relative windspeed in kts
|
||||||
rel_wind_speed_kts = sqrt(pow(abs(rel_wind_speed_from_east_kts), 2)
|
rel_wind_speed_kts = sqrt(pow(abs(rel_wind_speed_from_east_kts), 2)
|
||||||
+ pow(abs(rel_wind_speed_from_north_kts), 2));
|
+ pow(abs(rel_wind_speed_from_north_kts), 2));
|
||||||
|
|
||||||
//calculate the relative wind direction
|
//calculate the relative wind direction
|
||||||
|
@ -138,6 +138,6 @@ void main()
|
||||||
gl_BackColor.rgb = ambient_term.rgb; gl_FrontColor.a = 1.0;
|
gl_BackColor.rgb = ambient_term.rgb; gl_FrontColor.a = 1.0;
|
||||||
// fogCoord = abs(ecPosition.z / ecPosition.w);
|
// fogCoord = abs(ecPosition.z / ecPosition.w);
|
||||||
|
|
||||||
fog_Func(fogType);
|
//fog_Func(fogType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,11 +10,11 @@ varying vec4 constantColor;
|
||||||
attribute vec3 tangent;
|
attribute vec3 tangent;
|
||||||
attribute vec3 binormal;
|
attribute vec3 binormal;
|
||||||
|
|
||||||
////fog "include"////////
|
// ////fog "include"////////
|
||||||
uniform int fogType;
|
// uniform int fogType;
|
||||||
|
//
|
||||||
void fog_Func(int type);
|
// void fog_Func(int type);
|
||||||
/////////////////////////
|
// /////////////////////////
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
|
@ -30,5 +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);
|
// fog_Func(fogType);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,12 @@
|
||||||
//#define fog_FuncTION
|
//#define fog_FuncTION
|
||||||
//default fog
|
//varying vec3 PointPos;
|
||||||
//varying float fogCoord;
|
|
||||||
varying vec3 PointPos;
|
|
||||||
//varying vec4 EyePos;
|
|
||||||
|
|
||||||
vec3 fog_Func(vec3 color, int type)
|
vec3 fog_Func(vec3 color, int type)
|
||||||
{
|
{
|
||||||
//if (type == 0){
|
//if (type == 0){
|
||||||
const float LOG2 = 1.442695;
|
const float LOG2 = 1.442695;
|
||||||
//vec3 EyePos = vec3(0.0);
|
//float fogCoord =length(PointPos);
|
||||||
float fogCoord =length(PointPos);
|
float fogCoord = gl_FragCoord.z / gl_FragCoord.w;
|
||||||
float fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
float fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
||||||
|
|
||||||
if(gl_Fog.density == 1.0)
|
if(gl_Fog.density == 1.0)
|
||||||
|
|
|
@ -32,9 +32,9 @@ attribute vec3 binormal;
|
||||||
uniform float canopy_height;
|
uniform float canopy_height;
|
||||||
|
|
||||||
////fog "include"////////
|
////fog "include"////////
|
||||||
uniform int fogType;
|
// uniform int fogType;
|
||||||
|
//
|
||||||
void fog_Func(int type);
|
// void fog_Func(int type);
|
||||||
/////////////////////////
|
/////////////////////////
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
|
@ -55,5 +55,5 @@ void main(void)
|
||||||
constantColorIn = gl_FrontMaterial.emission
|
constantColorIn = gl_FrontMaterial.emission
|
||||||
+ gl_Color * (gl_LightModel.ambient + gl_LightSource[0].ambient);
|
+ gl_Color * (gl_LightModel.ambient + gl_LightSource[0].ambient);
|
||||||
|
|
||||||
fog_Func(fogType);
|
// fog_Func(fogType);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,12 +9,12 @@ varying vec4 constantColor;
|
||||||
attribute vec3 tangent;
|
attribute vec3 tangent;
|
||||||
attribute vec3 binormal;
|
attribute vec3 binormal;
|
||||||
|
|
||||||
////fog "include" /////
|
// ////fog "include" /////
|
||||||
uniform int fogType;
|
// uniform int fogType;
|
||||||
|
//
|
||||||
void fog_Func(int type);
|
// void fog_Func(int type);
|
||||||
|
//
|
||||||
//////////////////////
|
// //////////////////////
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
|
@ -27,9 +27,9 @@ void main(void)
|
||||||
|
|
||||||
gl_FrontColor = gl_Color;
|
gl_FrontColor = gl_Color;
|
||||||
constantColor = gl_FrontMaterial.emission
|
constantColor = gl_FrontMaterial.emission
|
||||||
+ 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);
|
// fog_Func(fogType);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
varying float fogCoord;
|
#version 120
|
||||||
|
//varying float fogCoord;
|
||||||
|
////fog "include" /////
|
||||||
|
uniform int fogType;
|
||||||
|
|
||||||
|
vec3 fog_Func(vec3 color, int type);
|
||||||
|
//////////////////////
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
varying float fogCoord;
|
// varying float fogCoord;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec3 ecPosition = vec3(gl_ModelViewMatrix * gl_Vertex);
|
// vec3 ecPosition = vec3(gl_ModelViewMatrix * gl_Vertex);
|
||||||
|
|
||||||
gl_Position = ftransform();
|
gl_Position = ftransform();
|
||||||
fogCoord = abs(ecPosition.z);
|
// fogCoord = abs(ecPosition.z);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
|
|
||||||
// Ambient term comes in gl_Color.rgb.
|
// Ambient term comes in gl_Color.rgb.
|
||||||
//
|
//
|
||||||
// See http://wiki.flightgear.org/index.php/Howto:_Lightmap for details on
|
// See http://wiki.flightgear.org/index.php/Howto:_Lightmap for details on
|
||||||
// how to use it.
|
// how to use it.
|
||||||
|
|
||||||
varying vec4 diffuse_term;
|
varying vec4 diffuse_term;
|
||||||
varying vec3 normal;
|
varying vec3 normal;
|
||||||
varying float fogCoord;
|
//varying float fogCoord;
|
||||||
|
|
||||||
uniform sampler2D texture;
|
uniform sampler2D texture;
|
||||||
|
|
||||||
|
@ -16,6 +16,13 @@ uniform float condition;
|
||||||
uniform float lightmap_factor;
|
uniform float lightmap_factor;
|
||||||
uniform sampler2D lightmap_texture;
|
uniform sampler2D lightmap_texture;
|
||||||
|
|
||||||
|
////fog "include" /////
|
||||||
|
uniform int fogType;
|
||||||
|
|
||||||
|
vec3 fog_Func(vec3 color, int type);
|
||||||
|
//////////////////////
|
||||||
|
|
||||||
|
|
||||||
float luminance(vec3 color)
|
float luminance(vec3 color)
|
||||||
{
|
{
|
||||||
return dot(vec3(0.212671, 0.715160, 0.072169), color);
|
return dot(vec3(0.212671, 0.715160, 0.072169), color);
|
||||||
|
@ -53,13 +60,15 @@ void main()
|
||||||
color = clamp(color, 0.0, 1.0);
|
color = clamp(color, 0.0, 1.0);
|
||||||
texel = texture2D(texture, gl_TexCoord[0].st);
|
texel = texture2D(texture, gl_TexCoord[0].st);
|
||||||
fragColor = color * texel + specular;
|
fragColor = color * texel + specular;
|
||||||
|
|
||||||
// The lightmap function
|
// The lightmap function
|
||||||
if ( condition >= 1.0 ) {
|
if ( condition >= 1.0 ) {
|
||||||
vec3 lightmapTexel = texture2D(lightmap_texture, gl_TexCoord[0].st).rgb * lightmap_factor;
|
vec3 lightmapTexel = texture2D(lightmap_texture, gl_TexCoord[0].st).rgb * lightmap_factor;
|
||||||
fragColor.rgb = max(fragColor.rgb, lightmapTexel * gl_FrontMaterial.diffuse.rgb * texel.rgb);
|
fragColor.rgb = max(fragColor.rgb, lightmapTexel * gl_FrontMaterial.diffuse.rgb * texel.rgb);
|
||||||
}
|
}
|
||||||
|
|
||||||
fogFactor = exp(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord);
|
// fogFactor = exp(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord);
|
||||||
gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor);
|
// gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor);
|
||||||
|
fragColor.rgb = fog_Func(fragColor.rgb, fogType);
|
||||||
|
gl_FragColor = fragColor;
|
||||||
}
|
}
|
|
@ -8,7 +8,7 @@
|
||||||
// Diffuse colors come from the gl_Color, ambient from the material. This is
|
// Diffuse colors come from the gl_Color, ambient from the material. This is
|
||||||
// equivalent to osg::Material::DIFFUSE.
|
// equivalent to osg::Material::DIFFUSE.
|
||||||
//
|
//
|
||||||
// See http://wiki.flightgear.org/index.php/Howto:_Lightmap for details on
|
// See http://wiki.flightgear.org/index.php/Howto:_Lightmap for details on
|
||||||
// how to use it.
|
// how to use it.
|
||||||
|
|
||||||
#define MODE_OFF 0
|
#define MODE_OFF 0
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
// bugs with gl_FrontFacing in the fragment shader.
|
// bugs with gl_FrontFacing in the fragment shader.
|
||||||
varying vec4 diffuse_term;
|
varying vec4 diffuse_term;
|
||||||
varying vec3 normal;
|
varying vec3 normal;
|
||||||
varying float fogCoord;
|
//varying float fogCoord;
|
||||||
uniform int colorMode;
|
uniform int colorMode;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
|
@ -54,5 +54,5 @@ void main()
|
||||||
// gl_FrontFacing in the fragment shader.
|
// gl_FrontFacing in the fragment shader.
|
||||||
gl_FrontColor.rgb = constant_term.rgb; gl_FrontColor.a = 1.0;
|
gl_FrontColor.rgb = constant_term.rgb; gl_FrontColor.a = 1.0;
|
||||||
gl_BackColor.rgb = constant_term.rgb; gl_BackColor.a = 0.0;
|
gl_BackColor.rgb = constant_term.rgb; gl_BackColor.a = 0.0;
|
||||||
fogCoord = abs(ecPosition.z / ecPosition.w);
|
//fogCoord = abs(ecPosition.z / ecPosition.w);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,17 @@
|
||||||
// Shader for use with material animations
|
// Shader for use with material animations
|
||||||
varying vec4 diffuse, constantColor, matSpecular;
|
varying vec4 diffuse, constantColor, matSpecular;
|
||||||
varying vec3 normal;
|
varying vec3 normal;
|
||||||
varying float fogCoord, alpha;
|
//varying float fogCoord, alpha;
|
||||||
|
varying float alpha;
|
||||||
|
|
||||||
uniform sampler2D texture;
|
uniform sampler2D texture;
|
||||||
|
|
||||||
|
////fog "include" /////
|
||||||
|
uniform int fogType;
|
||||||
|
|
||||||
|
vec3 fog_Func(vec3 color, int type);
|
||||||
|
//////////////////////
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec3 n, halfV;
|
vec3 n, halfV;
|
||||||
|
@ -37,6 +44,8 @@ void main()
|
||||||
color = clamp(color, 0.0, 1.0);
|
color = clamp(color, 0.0, 1.0);
|
||||||
texel = texture2D(texture, gl_TexCoord[0].st);
|
texel = texture2D(texture, gl_TexCoord[0].st);
|
||||||
fragColor = color * texel + specular;
|
fragColor = color * texel + specular;
|
||||||
fogFactor = exp(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord);
|
//fogFactor = exp(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord);
|
||||||
gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor);
|
//gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor);
|
||||||
|
fragColor.rgb = fog_Func(fragColor.rgb, fogType);
|
||||||
|
gl_FragColor = fragColor;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,12 +14,13 @@ vec4 emissionColor();
|
||||||
|
|
||||||
varying vec4 diffuse, constantColor, matSpecular;
|
varying vec4 diffuse, constantColor, matSpecular;
|
||||||
varying vec3 normal;
|
varying vec3 normal;
|
||||||
varying float alpha, fogCoord;
|
//varying float alpha, fogCoord;
|
||||||
|
varying float alpha;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
//vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
||||||
vec3 ecPosition3 = vec3(gl_ModelViewMatrix * gl_Vertex) / ecPosition.w;
|
//vec3 ecPosition3 = vec3(gl_ModelViewMatrix * gl_Vertex) / ecPosition.w;
|
||||||
gl_Position = ftransform();
|
gl_Position = ftransform();
|
||||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||||
normal = gl_NormalMatrix * gl_Normal;
|
normal = gl_NormalMatrix * gl_Normal;
|
||||||
|
@ -32,6 +33,6 @@ void main()
|
||||||
alpha = diffuse.a;
|
alpha = diffuse.a;
|
||||||
constantColor = emissionColor()
|
constantColor = emissionColor()
|
||||||
+ ambientColor() * (gl_LightModel.ambient + gl_LightSource[0].ambient);
|
+ ambientColor() * (gl_LightModel.ambient + gl_LightSource[0].ambient);
|
||||||
fogCoord = abs(ecPosition3.z);
|
//fogCoord = abs(ecPosition3.z);
|
||||||
matSpecular = specularColor();
|
matSpecular = specularColor();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// -*-C++-*-
|
// -*-C++-*-
|
||||||
|
#version 120
|
||||||
|
|
||||||
vec4 ambientColor()
|
vec4 ambientColor()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// -*-C++-*-
|
// -*-C++-*-
|
||||||
|
#version 120
|
||||||
|
|
||||||
vec4 ambientColor()
|
vec4 ambientColor()
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,10 +3,16 @@
|
||||||
// Ambient term comes in gl_Color.rgb.
|
// Ambient term comes in gl_Color.rgb.
|
||||||
varying vec4 diffuse_term;
|
varying vec4 diffuse_term;
|
||||||
varying vec3 normal;
|
varying vec3 normal;
|
||||||
varying float fogCoord;
|
//varying float fogCoord;
|
||||||
|
|
||||||
uniform sampler2D texture;
|
uniform sampler2D texture;
|
||||||
|
|
||||||
|
////fog "include" /////
|
||||||
|
uniform int fogType;
|
||||||
|
|
||||||
|
vec3 fog_Func(vec3 color, int type);
|
||||||
|
//////////////////////
|
||||||
|
|
||||||
float luminance(vec3 color)
|
float luminance(vec3 color)
|
||||||
{
|
{
|
||||||
return dot(vec3(0.212671, 0.715160, 0.072169), color);
|
return dot(vec3(0.212671, 0.715160, 0.072169), color);
|
||||||
|
@ -43,6 +49,8 @@ void main()
|
||||||
color = clamp(color, 0.0, 1.0);
|
color = clamp(color, 0.0, 1.0);
|
||||||
texel = texture2D(texture, gl_TexCoord[0].st);
|
texel = texture2D(texture, gl_TexCoord[0].st);
|
||||||
fragColor = color * texel + specular;
|
fragColor = color * texel + specular;
|
||||||
fogFactor = exp(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord);
|
//fogFactor = exp(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord);
|
||||||
gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor);
|
//gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor);
|
||||||
|
fragColor.rgb = fog_Func(fragColor.rgb, fogType);
|
||||||
|
gl_FragColor = fragColor;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
//
|
//
|
||||||
// Diffuse colors come from the gl_Color, ambient from the material. This is
|
// Diffuse colors come from the gl_Color, ambient from the material. This is
|
||||||
// equivalent to osg::Material::DIFFUSE.
|
// equivalent to osg::Material::DIFFUSE.
|
||||||
|
#version 120
|
||||||
|
|
||||||
#define MODE_OFF 0
|
#define MODE_OFF 0
|
||||||
#define MODE_DIFFUSE 1
|
#define MODE_DIFFUSE 1
|
||||||
|
@ -18,13 +19,13 @@
|
||||||
// bugs with gl_FrontFacing in the fragment shader.
|
// bugs with gl_FrontFacing in the fragment shader.
|
||||||
varying vec4 diffuse_term;
|
varying vec4 diffuse_term;
|
||||||
varying vec3 normal;
|
varying vec3 normal;
|
||||||
varying float fogCoord;
|
//varying float fogCoord;
|
||||||
|
|
||||||
uniform int colorMode;
|
uniform int colorMode;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
//vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
||||||
gl_Position = ftransform();
|
gl_Position = ftransform();
|
||||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||||
normal = gl_NormalMatrix * gl_Normal;
|
normal = gl_NormalMatrix * gl_Normal;
|
||||||
|
@ -51,5 +52,5 @@ void main()
|
||||||
// gl_FrontFacing in the fragment shader.
|
// gl_FrontFacing in the fragment shader.
|
||||||
gl_FrontColor.rgb = ambient_term.rgb; gl_FrontColor.a = 1.0;
|
gl_FrontColor.rgb = ambient_term.rgb; gl_FrontColor.a = 1.0;
|
||||||
gl_BackColor.rgb = ambient_term.rgb; gl_FrontColor.a = 0.0;
|
gl_BackColor.rgb = ambient_term.rgb; gl_FrontColor.a = 0.0;
|
||||||
fogCoord = abs(ecPosition.z / ecPosition.w);
|
//fogCoord = abs(ecPosition.z / ecPosition.w);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ float shade = 0.8;
|
||||||
float cloud_height = 1000.0;
|
float cloud_height = 1000.0;
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||||
//gl_TexCoord[0] = gl_MultiTexCoord0 + vec4(textureIndexX, textureIndexY, 0.0, 0.0);
|
//gl_TexCoord[0] = gl_MultiTexCoord0 + vec4(textureIndexX, textureIndexY, 0.0, 0.0);
|
||||||
|
|
|
@ -14,7 +14,7 @@ varying vec3 reflVec;
|
||||||
|
|
||||||
varying vec4 Diffuse;
|
varying vec4 Diffuse;
|
||||||
varying float alpha;
|
varying float alpha;
|
||||||
varying float fogCoord;
|
//varying float fogCoord;
|
||||||
|
|
||||||
uniform samplerCube Environment;
|
uniform samplerCube Environment;
|
||||||
uniform sampler2D Rainbow;
|
uniform sampler2D Rainbow;
|
||||||
|
@ -32,6 +32,12 @@ uniform float ambient_correction;
|
||||||
uniform float reflect_map;
|
uniform float reflect_map;
|
||||||
uniform float normalmap_dds;
|
uniform float normalmap_dds;
|
||||||
|
|
||||||
|
////fog "include" /////
|
||||||
|
uniform int fogType;
|
||||||
|
|
||||||
|
vec3 fog_Func(vec3 color, int type);
|
||||||
|
//////////////////////
|
||||||
|
|
||||||
void main (void)
|
void main (void)
|
||||||
{
|
{
|
||||||
vec3 halfV;
|
vec3 halfV;
|
||||||
|
@ -72,12 +78,12 @@ void main (void)
|
||||||
color = clamp(color, 0.0, 1.0);
|
color = clamp(color, 0.0, 1.0);
|
||||||
|
|
||||||
// calculate the fog factor
|
// calculate the fog factor
|
||||||
const float LOG2 = 1.442695;
|
// const float LOG2 = 1.442695;
|
||||||
float fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
// float fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
||||||
fogFactor = clamp(fogFactor, 0.0, 1.0);
|
// fogFactor = clamp(fogFactor, 0.0, 1.0);
|
||||||
|
//
|
||||||
if(gl_Fog.density == 1.0)
|
// if(gl_Fog.density == 1.0)
|
||||||
fogFactor=1.0;
|
// fogFactor=1.0;
|
||||||
|
|
||||||
vec3 normal = normalize(VNormal);
|
vec3 normal = normalize(VNormal);
|
||||||
vec3 viewVec = normalize(vViewVec);
|
vec3 viewVec = normalize(vViewVec);
|
||||||
|
@ -129,5 +135,7 @@ void main (void)
|
||||||
|
|
||||||
reflColor = clamp(reflColor, 0.0, 1.0);
|
reflColor = clamp(reflColor, 0.0, 1.0);
|
||||||
|
|
||||||
gl_FragColor = mix(gl_Fog.color, reflColor, fogFactor);
|
// gl_FragColor = mix(gl_Fog.color, reflColor, fogFactor);
|
||||||
|
reflColor.rgb = fog_Func(reflColor.rgb, fogType);
|
||||||
|
gl_FragColor = reflColor;
|
||||||
}
|
}
|
|
@ -19,10 +19,10 @@ uniform mat4 osg_ViewMatrixInverse;
|
||||||
attribute vec3 tangent;
|
attribute vec3 tangent;
|
||||||
attribute vec3 binormal;
|
attribute vec3 binormal;
|
||||||
|
|
||||||
////fog "include"////////
|
////fog "include"////////
|
||||||
uniform int fogType;
|
// uniform int fogType;
|
||||||
|
//
|
||||||
void fog_Func(int type);
|
// void fog_Func(int type);
|
||||||
/////////////////////////
|
/////////////////////////
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
|
@ -30,8 +30,8 @@ void main(void)
|
||||||
rawpos = gl_Vertex.xyz / gl_Vertex.w;
|
rawpos = gl_Vertex.xyz / gl_Vertex.w;
|
||||||
vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
||||||
ecPosition.xyz = ecPosition.xyz / ecPosition.w;
|
ecPosition.xyz = ecPosition.xyz / ecPosition.w;
|
||||||
fogCoord = ecPosition.z;
|
//fogCoord = ecPosition.z;
|
||||||
fog_Func(fogType);
|
//fog_Func(fogType);
|
||||||
|
|
||||||
vec3 n = normalize(gl_Normal);
|
vec3 n = normalize(gl_Normal);
|
||||||
vec3 t = cross(gl_Normal, vec3(1.0,0.0,0.0));
|
vec3 t = cross(gl_Normal, vec3(1.0,0.0,0.0));
|
||||||
|
|
|
@ -13,7 +13,7 @@ varying vec3 reflVec;
|
||||||
|
|
||||||
varying vec4 Diffuse;
|
varying vec4 Diffuse;
|
||||||
varying float alpha;
|
varying float alpha;
|
||||||
varying float fogCoord;
|
//varying float fogCoord;
|
||||||
|
|
||||||
uniform samplerCube Environment;
|
uniform samplerCube Environment;
|
||||||
uniform sampler2D Rainbow;
|
uniform sampler2D Rainbow;
|
||||||
|
@ -33,6 +33,12 @@ uniform float lightmap_factor;
|
||||||
uniform int light_map;
|
uniform int light_map;
|
||||||
uniform int reflect_map;
|
uniform int reflect_map;
|
||||||
|
|
||||||
|
////fog "include" /////
|
||||||
|
uniform int fogType;
|
||||||
|
|
||||||
|
vec3 fog_Func(vec3 color, int type);
|
||||||
|
//////////////////////
|
||||||
|
|
||||||
void main (void)
|
void main (void)
|
||||||
{
|
{
|
||||||
vec3 n, halfV;
|
vec3 n, halfV;
|
||||||
|
@ -62,12 +68,12 @@ void main (void)
|
||||||
color = clamp(color, 0.0, 1.0);
|
color = clamp(color, 0.0, 1.0);
|
||||||
|
|
||||||
// calculate the fog factor
|
// calculate the fog factor
|
||||||
const float LOG2 = 1.442695;
|
// const float LOG2 = 1.442695;
|
||||||
float fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
// float fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
||||||
fogFactor = clamp(fogFactor, 0.0, 1.0);
|
// fogFactor = clamp(fogFactor, 0.0, 1.0);
|
||||||
|
//
|
||||||
if(gl_Fog.density == 1.0)
|
// if(gl_Fog.density == 1.0)
|
||||||
fogFactor=1.0;
|
// fogFactor=1.0;
|
||||||
|
|
||||||
vec3 normal = normalize(VNormal);
|
vec3 normal = normalize(VNormal);
|
||||||
vec3 viewVec = normalize(vViewVec);
|
vec3 viewVec = normalize(vViewVec);
|
||||||
|
@ -127,5 +133,7 @@ void main (void)
|
||||||
reflColor.rgb = max(reflColor.rgb, lightmapTexel * gl_FrontMaterial.diffuse.rgb * mixedcolor.rgb);
|
reflColor.rgb = max(reflColor.rgb, lightmapTexel * gl_FrontMaterial.diffuse.rgb * mixedcolor.rgb);
|
||||||
}
|
}
|
||||||
|
|
||||||
gl_FragColor = mix(gl_Fog.color, reflColor, fogFactor);
|
// gl_FragColor = mix(gl_Fog.color, reflColor, fogFactor);
|
||||||
|
reflColor.rgb = fog_Func(reflColor.rgb, fogType);
|
||||||
|
gl_FragColor = reflColor;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ varying vec3 reflVec;
|
||||||
|
|
||||||
varying vec4 Diffuse;
|
varying vec4 Diffuse;
|
||||||
varying float alpha;
|
varying float alpha;
|
||||||
varying float fogCoord;
|
//varying float fogCoord;
|
||||||
|
|
||||||
uniform mat4 osg_ViewMatrixInverse;
|
uniform mat4 osg_ViewMatrixInverse;
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ void main(void)
|
||||||
else
|
else
|
||||||
alpha = gl_Color.a;
|
alpha = gl_Color.a;
|
||||||
|
|
||||||
fogCoord = abs(ecPosition.z);
|
//fogCoord = abs(ecPosition.z);
|
||||||
|
|
||||||
// Vertex in eye coordinates
|
// Vertex in eye coordinates
|
||||||
vec3 vertVec = ecPosition.xyz;
|
vec3 vertVec = ecPosition.xyz;
|
||||||
|
|
|
@ -13,7 +13,7 @@ varying vec3 reflVec;
|
||||||
|
|
||||||
varying vec4 Diffuse;
|
varying vec4 Diffuse;
|
||||||
varying float alpha;
|
varying float alpha;
|
||||||
varying float fogCoord;
|
//varying float fogCoord;
|
||||||
|
|
||||||
uniform samplerCube Environment;
|
uniform samplerCube Environment;
|
||||||
uniform sampler2D Rainbow;
|
uniform sampler2D Rainbow;
|
||||||
|
|
|
@ -1,11 +1,18 @@
|
||||||
// -*-C++-*-
|
// -*-C++-*-
|
||||||
|
#version 120
|
||||||
varying vec4 diffuse, constantColor;
|
varying vec4 diffuse, constantColor;
|
||||||
varying vec3 normal, lightDir, halfVector;
|
varying vec3 normal, lightDir, halfVector;
|
||||||
varying float fogCoord, alpha;
|
//varying float fogCoord, alpha;
|
||||||
|
varying float alpha;
|
||||||
|
|
||||||
uniform sampler2D texture;
|
uniform sampler2D texture;
|
||||||
|
|
||||||
|
////fog "include" /////
|
||||||
|
uniform int fogType;
|
||||||
|
|
||||||
|
vec3 fog_Func(vec3 color, int type);
|
||||||
|
//////////////////////
|
||||||
|
|
||||||
float luminance(vec3 color)
|
float luminance(vec3 color)
|
||||||
{
|
{
|
||||||
return dot(vec3(0.212671, 0.715160, 0.072169), color);
|
return dot(vec3(0.212671, 0.715160, 0.072169), color);
|
||||||
|
@ -51,7 +58,8 @@ void main()
|
||||||
fragColor.a = tex_lum * clamp(lum, 0.01, 1.0);
|
fragColor.a = tex_lum * clamp(lum, 0.01, 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
fogFactor = exp(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord);
|
// fogFactor = exp(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord);
|
||||||
gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor);
|
// gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor);
|
||||||
|
fragColor.rgb = fog_Func(fragColor.rgb, fogType);
|
||||||
|
gl_FragColor = fragColor;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,8 @@ varying vec4 diffuse_term, RawPos;
|
||||||
varying vec3 Vnormal, normal;
|
varying vec3 Vnormal, normal;
|
||||||
//varying float fogCoord;
|
//varying float fogCoord;
|
||||||
|
|
||||||
uniform float SnowLevel, Transitions, InverseSlope, RainNorm, CloudCover0, CloudCover1, CloudCover2, CloudCover3, CloudCover4;
|
uniform float SnowLevel, Transitions, InverseSlope, RainNorm;
|
||||||
|
uniform float CloudCover0, CloudCover1, CloudCover2, CloudCover3, CloudCover4;
|
||||||
uniform sampler2D BaseTex, SecondTex, ThirdTex, SnowTex;
|
uniform sampler2D BaseTex, SecondTex, ThirdTex, SnowTex;
|
||||||
uniform sampler3D NoiseTex;
|
uniform sampler3D NoiseTex;
|
||||||
|
|
||||||
|
@ -143,4 +144,4 @@ void main()
|
||||||
fragColor.rgb = fog_Func(fragColor.rgb, fogType);
|
fragColor.rgb = fog_Func(fragColor.rgb, fogType);
|
||||||
//gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor);
|
//gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor);
|
||||||
gl_FragColor = fragColor;
|
gl_FragColor = fragColor;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,11 +22,11 @@ varying vec3 normal, Vnormal;
|
||||||
//varying float fogCoord;
|
//varying float fogCoord;
|
||||||
uniform int colorMode;
|
uniform int colorMode;
|
||||||
|
|
||||||
////fog "include"////////
|
// ////fog "include"////////
|
||||||
uniform int fogType;
|
// uniform int fogType;
|
||||||
|
//
|
||||||
void fog_Func(int type);
|
// void fog_Func(int type);
|
||||||
/////////////////////////
|
// /////////////////////////
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
|
@ -61,5 +61,5 @@ void main()
|
||||||
gl_FrontColor.rgb = constant_term.rgb; gl_FrontColor.a = 1.0;
|
gl_FrontColor.rgb = constant_term.rgb; gl_FrontColor.a = 1.0;
|
||||||
gl_BackColor.rgb = constant_term.rgb; gl_BackColor.a = 0.0;
|
gl_BackColor.rgb = constant_term.rgb; gl_BackColor.a = 0.0;
|
||||||
//fogCoord = abs(ecPosition.z / ecPosition.w);
|
//fogCoord = abs(ecPosition.z / ecPosition.w);
|
||||||
fog_Func(fogType);
|
//fog_Func(fogType);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,13 +5,13 @@
|
||||||
// color - xyz of tree quad origin, replicated 4 times.
|
// color - xyz of tree quad origin, replicated 4 times.
|
||||||
#version 120
|
#version 120
|
||||||
//varying float fogCoord;
|
//varying float fogCoord;
|
||||||
varying vec3 PointPos;
|
// varying vec3 PointPos;
|
||||||
//varying vec4 EyePos;
|
//varying vec4 EyePos;
|
||||||
////fog "include"////////
|
// ////fog "include"////////
|
||||||
uniform int fogType;
|
// uniform int fogType;
|
||||||
|
//
|
||||||
void fog_Func(int type);
|
// void fog_Func(int type);
|
||||||
/////////////////////////
|
// /////////////////////////
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
|
@ -41,6 +41,6 @@ void main(void)
|
||||||
//fogFactor = exp( -gl_Fog.density * gl_Fog.density * fogCoord * fogCoord);
|
//fogFactor = exp( -gl_Fog.density * gl_Fog.density * fogCoord * fogCoord);
|
||||||
//fogFactor = clamp(fogFactor, 0.0, 1.0);
|
//fogFactor = clamp(fogFactor, 0.0, 1.0);
|
||||||
// fog_Func(fogType);
|
// fog_Func(fogType);
|
||||||
PointPos = ecPosition;
|
// PointPos = ecPosition;
|
||||||
//EyePos = gl_ModelViewMatrixInverse * vec4(0.0,0.0,0.0,1.0);
|
//EyePos = gl_ModelViewMatrixInverse * vec4(0.0,0.0,0.0,1.0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,8 +23,8 @@ uniform int nmap_enabled;
|
||||||
uniform int shader_qual;
|
uniform int shader_qual;
|
||||||
|
|
||||||
//////Fog Include///////////
|
//////Fog Include///////////
|
||||||
uniform int fogType;
|
// uniform int fogType;
|
||||||
void fog_Func(int type);
|
// void fog_Func(int type);
|
||||||
////////////////////////////
|
////////////////////////////
|
||||||
|
|
||||||
void rotationMatrixPR(in float sinRx, in float cosRx, in float sinRy, in float cosRy, out mat4 rotmat)
|
void rotationMatrixPR(in float sinRx, in float cosRx, in float sinRy, in float cosRy, out mat4 rotmat)
|
||||||
|
@ -47,7 +47,7 @@ void main(void)
|
||||||
{
|
{
|
||||||
rawpos = gl_Vertex.xyz;
|
rawpos = gl_Vertex.xyz;
|
||||||
vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
||||||
fog_Func(fogType);
|
//fog_Func(fogType);
|
||||||
|
|
||||||
VNormal = normalize(gl_NormalMatrix * gl_Normal);
|
VNormal = normalize(gl_NormalMatrix * gl_Normal);
|
||||||
if (nmap_enabled > 0 && shader_qual > 2){
|
if (nmap_enabled > 0 && shader_qual > 2){
|
||||||
|
|
|
@ -13,9 +13,9 @@ varying vec4 constantColor;
|
||||||
attribute vec3 tangent, binormal;
|
attribute vec3 tangent, binormal;
|
||||||
|
|
||||||
////fog "include"////////
|
////fog "include"////////
|
||||||
uniform int fogType;
|
// uniform int fogType;
|
||||||
|
//
|
||||||
void fog_Func(int type);
|
// void fog_Func(int type);
|
||||||
/////////////////////////
|
/////////////////////////
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
|
@ -28,8 +28,8 @@ void main(void)
|
||||||
VBinormal = gl_NormalMatrix * binormal;
|
VBinormal = gl_NormalMatrix * binormal;
|
||||||
gl_FrontColor = gl_Color;
|
gl_FrontColor = gl_Color;
|
||||||
constantColor = gl_FrontMaterial.emission
|
constantColor = gl_FrontMaterial.emission
|
||||||
+ gl_Color * (gl_LightModel.ambient + gl_LightSource[0].ambient);
|
+ gl_Color * (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);
|
// fog_Func(fogType);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,9 +18,9 @@ uniform float osg_SimulationTime;
|
||||||
uniform float WindE, WindN, spd, hdg;
|
uniform float WindE, WindN, spd, hdg;
|
||||||
|
|
||||||
////fog "include"////////
|
////fog "include"////////
|
||||||
uniform int fogType;
|
// uniform int fogType;
|
||||||
|
//
|
||||||
void fog_Func(int type);
|
// void fog_Func(int type);
|
||||||
/////////////////////////
|
/////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,6 +72,6 @@ void main(void)
|
||||||
|
|
||||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||||
gl_Position = ftransform();
|
gl_Position = ftransform();
|
||||||
|
|
||||||
fog_Func(fogType);
|
// fog_Func(fogType);
|
||||||
}
|
}
|
|
@ -15,11 +15,17 @@ uniform float CloudCover0, CloudCover1, CloudCover2, CloudCover3, CloudCover4;
|
||||||
varying vec4 waterTex1; //moving texcoords
|
varying vec4 waterTex1; //moving texcoords
|
||||||
varying vec4 waterTex2; //moving texcoords
|
varying vec4 waterTex2; //moving texcoords
|
||||||
varying vec4 waterTex4; //viewts
|
varying vec4 waterTex4; //viewts
|
||||||
varying vec4 ecPosition;
|
//varying vec4 ecPosition;
|
||||||
varying vec3 viewerdir;
|
varying vec3 viewerdir;
|
||||||
varying vec3 lightdir;
|
varying vec3 lightdir;
|
||||||
varying vec3 normal;
|
varying vec3 normal;
|
||||||
|
|
||||||
|
////fog "include" /////
|
||||||
|
uniform int fogType;
|
||||||
|
|
||||||
|
vec3 fog_Func(vec3 color, int type);
|
||||||
|
//////////////////////
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
const vec4 sca = vec4(0.005, 0.005, 0.005, 0.005);
|
const vec4 sca = vec4(0.005, 0.005, 0.005, 0.005);
|
||||||
|
@ -96,19 +102,19 @@ void main(void)
|
||||||
|
|
||||||
//calculate fresnel
|
//calculate fresnel
|
||||||
vec4 invfres = vec4( dot(vNorm, viewt) );
|
vec4 invfres = vec4( dot(vNorm, viewt) );
|
||||||
vec4 fres = vec4(1.0) + invfres;
|
vec4 fres = vec4(1.0) + invfres;
|
||||||
refl *= fres;
|
refl *= fres;
|
||||||
|
|
||||||
//calculate the fog factor
|
//calculate the fog factor
|
||||||
float fogFactor;
|
// float fogFactor;
|
||||||
float fogCoord = ecPosition.z;
|
// float fogCoord = ecPosition.z;
|
||||||
const float LOG2 = 1.442695;
|
// const float LOG2 = 1.442695;
|
||||||
fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
// fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
||||||
|
//
|
||||||
|
// if(gl_Fog.density == 1.0)
|
||||||
|
// fogFactor=1.0;
|
||||||
|
|
||||||
if(gl_Fog.density == 1.0)
|
//calculate final colour
|
||||||
fogFactor=1.0;
|
|
||||||
|
|
||||||
//calculate final colour
|
|
||||||
vec4 ambient_light = gl_LightSource[0].diffuse;
|
vec4 ambient_light = gl_LightSource[0].diffuse;
|
||||||
vec4 finalColor;
|
vec4 finalColor;
|
||||||
|
|
||||||
|
@ -122,5 +128,7 @@ void main(void)
|
||||||
|
|
||||||
finalColor *= ambient_light;
|
finalColor *= ambient_light;
|
||||||
|
|
||||||
gl_FragColor = mix(gl_Fog.color, finalColor, fogFactor);
|
// gl_FragColor = mix(gl_Fog.color, finalColor, fogFactor);
|
||||||
|
finalColor.rgb = fog_Func(finalColor.rgb, fogType);
|
||||||
|
gl_FragColor = finalColor;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,11 @@ uniform sampler3D NoiseTex;
|
||||||
uniform float osg_SimulationTime;
|
uniform float osg_SimulationTime;
|
||||||
|
|
||||||
//const float scale = 1.0;
|
//const float scale = 1.0;
|
||||||
|
////fog "include" /////
|
||||||
|
uniform int fogType;
|
||||||
|
|
||||||
|
vec3 fog_Func(vec3 color, int type);
|
||||||
|
//////////////////////
|
||||||
|
|
||||||
void main (void)
|
void main (void)
|
||||||
{
|
{
|
||||||
|
@ -19,18 +24,18 @@ void main (void)
|
||||||
vec4 noisevec = texture3D(NoiseTex, (rawpos.xyz)*0.00423+vec3(0.0,0.0,osg_SimulationTime*0.035217));
|
vec4 noisevec = texture3D(NoiseTex, (rawpos.xyz)*0.00423+vec3(0.0,0.0,osg_SimulationTime*0.035217));
|
||||||
vec4 nvL = texture3D(NoiseTex, (rawpos.xyz)*0.001223417+(0.0,0.0,osg_SimulationTime*-0.0212));
|
vec4 nvL = texture3D(NoiseTex, (rawpos.xyz)*0.001223417+(0.0,0.0,osg_SimulationTime*-0.0212));
|
||||||
|
|
||||||
float fogFactor;
|
// float fogFactor;
|
||||||
if (gl_Fog.density == 1.0)
|
// if (gl_Fog.density == 1.0)
|
||||||
{
|
// {
|
||||||
fogFactor=1.0;
|
// fogFactor=1.0;
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
float fogCoord = ecPosition.z;
|
// float fogCoord = ecPosition.z;
|
||||||
const float LOG2 = 1.442695;
|
// const float LOG2 = 1.442695;
|
||||||
fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
// fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
||||||
fogFactor = clamp(fogFactor, 0.0, 1.0);
|
// fogFactor = clamp(fogFactor, 0.0, 1.0);
|
||||||
}
|
// }
|
||||||
|
|
||||||
float a=1.0;
|
float a=1.0;
|
||||||
float n=0.00;
|
float n=0.00;
|
||||||
|
@ -64,7 +69,7 @@ void main (void)
|
||||||
c1 = asin(vec4(smoothstep(0.0, 2.2, n), smoothstep(-0.1, 2.10, n), smoothstep(-0.2, 2.0, n), 1.0));
|
c1 = asin(vec4(smoothstep(0.0, 2.2, n), smoothstep(-0.1, 2.10, n), smoothstep(-0.2, 2.0, n), 1.0));
|
||||||
|
|
||||||
vec3 Eye = normalize(-ecPosition.xyz);
|
vec3 Eye = normalize(-ecPosition.xyz);
|
||||||
vec3 Reflected = normalize(reflect(-normalize(lightVec), normalize(VNormal+vec3(0.0,0.0,na*0.10-0.24))));
|
vec3 Reflected = normalize(reflect(-normalize(lightVec), normalize(VNormal+vec3(0.0,0.0,na*0.10-0.24))));
|
||||||
|
|
||||||
vec3 bump = normalize(VNormal+vec3(0.0, 0.0, na)-0.9);
|
vec3 bump = normalize(VNormal+vec3(0.0, 0.0, na)-0.9);
|
||||||
vec3 bumped = max(normalize(refract(lightVec, normalize(bump), 0.16)), 0.0);
|
vec3 bumped = max(normalize(refract(lightVec, normalize(bump), 0.16)), 0.0);
|
||||||
|
@ -82,5 +87,7 @@ void main (void)
|
||||||
c1 += gl_LightSource[0].specular * eyeFact * 4.0*bumpFact;
|
c1 += gl_LightSource[0].specular * eyeFact * 4.0*bumpFact;
|
||||||
|
|
||||||
vec4 finalColor = c1;
|
vec4 finalColor = c1;
|
||||||
gl_FragColor = mix(gl_Fog.color, finalColor, fogFactor);
|
// gl_FragColor = mix(gl_Fog.color, finalColor, fogFactor);
|
||||||
|
finalColor.rgb = fog_Func(finalColor.rgb, fogType);
|
||||||
|
gl_FragColor = finalColor;
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,13 +181,13 @@ void main(void)
|
||||||
refl *= fres;
|
refl *= fres;
|
||||||
|
|
||||||
//calculate the fog factor
|
//calculate the fog factor
|
||||||
float fogFactor;
|
// float fogFactor;
|
||||||
float fogCoord = ecPosition.z;
|
// float fogCoord = ecPosition.z;
|
||||||
const float LOG2 = 1.442695;
|
// const float LOG2 = 1.442695;
|
||||||
fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
// fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
||||||
|
//
|
||||||
if(gl_Fog.density == 1.0)
|
// if(gl_Fog.density == 1.0)
|
||||||
fogFactor=1.0;
|
// fogFactor=1.0;
|
||||||
|
|
||||||
//calculate final colour
|
//calculate final colour
|
||||||
vec4 ambient_light = gl_LightSource[0].diffuse;
|
vec4 ambient_light = gl_LightSource[0].diffuse;
|
||||||
|
@ -203,7 +203,7 @@ void main(void)
|
||||||
//float waveSlope = mix(N0.g, N1.g, 0.25);
|
//float waveSlope = mix(N0.g, N1.g, 0.25);
|
||||||
|
|
||||||
vec4 foam_texel = texture2D(sea_foam, vec2(waterTex2 * tscale) * 25.0);
|
vec4 foam_texel = texture2D(sea_foam, vec2(waterTex2 * tscale) * 25.0);
|
||||||
float waveSlope = N.g;
|
float waveSlope = N.g;
|
||||||
|
|
||||||
if (windEffect >= 8.0)
|
if (windEffect >= 8.0)
|
||||||
if (waveSlope >= foamSlope){
|
if (waveSlope >= foamSlope){
|
||||||
|
|
|
@ -20,9 +20,9 @@ uniform float osg_SimulationTime;
|
||||||
uniform float WindE, WindN;
|
uniform float WindE, WindN;
|
||||||
|
|
||||||
////fog "include"////////
|
////fog "include"////////
|
||||||
uniform int fogType;
|
// uniform int fogType;
|
||||||
|
//
|
||||||
void fog_Func(int type);
|
// void fog_Func(int type);
|
||||||
/////////////////////////
|
/////////////////////////
|
||||||
|
|
||||||
/////// functions /////////
|
/////// functions /////////
|
||||||
|
@ -66,6 +66,6 @@ void main(void)
|
||||||
rotationmatrix(Angle, RotationMatrix);
|
rotationmatrix(Angle, RotationMatrix);
|
||||||
waterTex2 = gl_MultiTexCoord0 * RotationMatrix - t2 * windFactor;
|
waterTex2 = gl_MultiTexCoord0 * RotationMatrix - t2 * windFactor;
|
||||||
|
|
||||||
fog_Func(fogType);
|
// fog_Func(fogType);
|
||||||
gl_Position = ftransform();
|
gl_Position = ftransform();
|
||||||
}
|
}
|
|
@ -24,7 +24,7 @@ uniform int Status;
|
||||||
varying vec4 waterTex1; //moving texcoords
|
varying vec4 waterTex1; //moving texcoords
|
||||||
varying vec4 waterTex2; //moving texcoords
|
varying vec4 waterTex2; //moving texcoords
|
||||||
varying vec4 waterTex4; //viewts
|
varying vec4 waterTex4; //viewts
|
||||||
varying vec4 ecPosition;
|
//varying vec4 ecPosition;
|
||||||
varying vec3 viewerdir;
|
varying vec3 viewerdir;
|
||||||
varying vec3 lightdir;
|
varying vec3 lightdir;
|
||||||
varying vec3 normal;
|
varying vec3 normal;
|
||||||
|
@ -263,7 +263,7 @@ void main(void)
|
||||||
|
|
||||||
if(cover >= 1.5){
|
if(cover >= 1.5){
|
||||||
refl= normalize(refTex);
|
refl= normalize(refTex);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
refl = normalize(refTexGrey);
|
refl = normalize(refTexGrey);
|
||||||
|
@ -291,7 +291,7 @@ void main(void)
|
||||||
N0 *= windEffect_low;
|
N0 *= windEffect_low;
|
||||||
N1 *= windEffect_low;
|
N1 *= windEffect_low;
|
||||||
|
|
||||||
N0.r += (ddx + ddx1 + ddx2 + ddx3);
|
N0.r += (ddx + ddx1 + ddx2 + ddx3);
|
||||||
N0.g += (ddy + ddy1 + ddy2 + ddy3);
|
N0.g += (ddy + ddy1 + ddy2 + ddy3);
|
||||||
|
|
||||||
vec3 N = normalize(mix(Normal + N0, Normal + N1, mixFactor) * waveRoughness);
|
vec3 N = normalize(mix(Normal + N0, Normal + N1, mixFactor) * waveRoughness);
|
||||||
|
@ -335,7 +335,7 @@ void main(void)
|
||||||
//float waveSlope = mix(N0.g, N1.g, 0.25);
|
//float waveSlope = mix(N0.g, N1.g, 0.25);
|
||||||
|
|
||||||
vec4 foam_texel = texture2D(sea_foam, vec2(waterTex2 * tscale) * 25.0);
|
vec4 foam_texel = texture2D(sea_foam, vec2(waterTex2 * tscale) * 25.0);
|
||||||
float waveSlope = N.g;
|
float waveSlope = N.g;
|
||||||
|
|
||||||
if (windEffect >= 8.0)
|
if (windEffect >= 8.0)
|
||||||
if (waveSlope >= foamSlope){
|
if (waveSlope >= foamSlope){
|
||||||
|
|
Loading…
Reference in a new issue