1
0
Fork 0

Add include fog

Signed-off-by: Vivian Meazza <vivian.meazza@lineone.net>
This commit is contained in:
Vivian Meazza 2011-11-28 20:22:10 +00:00
parent b8d57b9474
commit cc329668dc

View file

@ -10,11 +10,37 @@
<wrap-t>repeat</wrap-t> <wrap-t>repeat</wrap-t>
<internal-format>normalized</internal-format> <internal-format>normalized</internal-format>
</texture> </texture>
<snow-level><use>/sim/rendering/snow-level-m</use></snow-level> <snow-level>
<use>/environment/snow-level-m</use>
</snow-level>
<depth-factor type="float">0.01</depth-factor> <depth-factor type="float">0.01</depth-factor>
<canopy-height type="float">15.0</canopy-height> <canopy-height type="float">15.0</canopy-height>
<quality-level><use>/sim/rendering/quality-level</use></quality-level> <quality-level>
<use>/sim/rendering/shaders/quality-level</use>
</quality-level>
</parameters> </parameters>
<!--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/scattering-shader</use>
</fogtype>
<!-- END fog include -->
<generate> <generate>
<tangent type="int">6</tangent> <tangent type="int">6</tangent>
<binormal type="int">7</binormal> <binormal type="int">7</binormal>
@ -22,11 +48,10 @@
<technique n="8"> <technique n="8">
<predicate> <predicate>
<and> <and>
<property>/sim/rendering/landmass-shader</property> <property>/sim/rendering/shaders/landmass</property>
<property>/sim/rendering/shader-effects</property>
<less-equal> <less-equal>
<value type="float">4.5</value> <value type="float">4.5</value>
<float-property>/sim/rendering/quality-level</float-property> <float-property>/sim/rendering/shaders/quality-level</float-property>
</less-equal> </less-equal>
<or> <or>
<less-equal> <less-equal>
@ -46,12 +71,20 @@
<pass> <pass>
<lighting>true</lighting> <lighting>true</lighting>
<material> <material>
<ambient><use>material/ambient</use></ambient> <ambient>
<diffuse><use>material/diffuse</use></diffuse> <use>material/ambient</use>
<specular><use>material/specular</use></specular> </ambient>
<diffuse>
<use>material/diffuse</use>
</diffuse>
<specular>
<use>material/specular</use>
</specular>
<color-mode>ambient-and-diffuse</color-mode> <color-mode>ambient-and-diffuse</color-mode>
</material> </material>
<alpha-test><use>transparent</use></alpha-test> <alpha-test>
<use>transparent</use>
</alpha-test>
<shade-model>smooth</shade-model> <shade-model>smooth</shade-model>
<cull-face>back</cull-face> <cull-face>back</cull-face>
<render-bin> <render-bin>
@ -60,18 +93,28 @@
</render-bin> </render-bin>
<texture-unit> <texture-unit>
<unit>1</unit> <unit>1</unit>
<image><use>texture[0]/image</use></image> <image>
<filter><use>texture[0]/filter</use></filter> <use>texture[0]/image</use>
<wrap-s><use>texture[0]/wrap-s</use></wrap-s> </image>
<wrap-t><use>texture[0]/wrap-t</use></wrap-t> <filter>
<use>texture[0]/filter</use>
</filter>
<wrap-s>
<use>texture[0]/wrap-s</use>
</wrap-s>
<wrap-t>
<use>texture[0]/wrap-t</use>
</wrap-t>
<internal-format> <internal-format>
<use>texture[0]/internal-format</use> <use>texture[0]/internal-format</use>
</internal-format> </internal-format>
</texture-unit> </texture-unit>
<program> <program>
<vertex-shader>Shaders/landmass-g.vert</vertex-shader> <vertex-shader n="0">Shaders/include_fog.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>Shaders/terrain-nocolor.frag</fragment-shader> <fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
<fragment-shader n="1">Shaders/terrain-nocolor.frag</fragment-shader>
<geometry-vertices-out type="int">18</geometry-vertices-out> <geometry-vertices-out type="int">18</geometry-vertices-out>
<geometry-input-type>triangles</geometry-input-type> <geometry-input-type>triangles</geometry-input-type>
<geometry-output-type>triangle-strip</geometry-output-type> <geometry-output-type>triangle-strip</geometry-output-type>
@ -92,25 +135,87 @@
<uniform> <uniform>
<name>canopy_height</name> <name>canopy_height</name>
<type>float</type> <type>float</type>
<value><use>canopy-height</use></value> <value>
<use>canopy-height</use>
</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 -->
<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>
<pass> <pass>
<lighting>true</lighting> <lighting>true</lighting>
<material> <material>
<ambient><use>material/ambient</use></ambient> <ambient>
<diffuse><use>material/diffuse</use></diffuse> <use>material/ambient</use>
<specular><use>material/specular</use></specular> </ambient>
<diffuse>
<use>material/diffuse</use>
</diffuse>
<specular>
<use>material/specular</use>
</specular>
<color-mode>ambient-and-diffuse</color-mode> <color-mode>ambient-and-diffuse</color-mode>
</material> </material>
<blend><use>transparent</use></blend> <blend>
<alpha-test><use>transparent</use></alpha-test> <use>transparent</use>
</blend>
<alpha-test>
<use>transparent</use>
</alpha-test>
<shade-model>smooth</shade-model> <shade-model>smooth</shade-model>
<cull-face>back</cull-face> <cull-face>back</cull-face>
<render-bin> <render-bin>
<bin-number><use>render-bin/bin-number</use></bin-number> <bin-number>
<bin-name><use>render-bin/bin-name</use></bin-name> <use>render-bin/bin-number</use>
</bin-number>
<bin-name>
<use>render-bin/bin-name</use>
</bin-name>
</render-bin> </render-bin>
<texture-unit> <texture-unit>
<unit>0</unit> <unit>0</unit>
@ -118,28 +223,46 @@
</texture-unit> </texture-unit>
<texture-unit> <texture-unit>
<unit>1</unit> <unit>1</unit>
<image><use>texture[0]/image</use></image> <image>
<filter><use>texture[0]/filter</use></filter> <use>texture[0]/image</use>
<wrap-s><use>texture[0]/wrap-s</use></wrap-s> </image>
<wrap-t><use>texture[0]/wrap-t</use></wrap-t> <filter>
<use>texture[0]/filter</use>
</filter>
<wrap-s>
<use>texture[0]/wrap-s</use>
</wrap-s>
<wrap-t>
<use>texture[0]/wrap-t</use>
</wrap-t>
<internal-format> <internal-format>
<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>2</unit> <unit>2</unit>
<image><use>texture[2]/image</use></image> <image>
<filter><use>texture[2]/filter</use></filter> <use>texture[2]/image</use>
<wrap-s><use>texture[2]/wrap-s</use></wrap-s> </image>
<wrap-t><use>texture[2]/wrap-t</use></wrap-t> <filter>
<use>texture[2]/filter</use>
</filter>
<wrap-s>
<use>texture[2]/wrap-s</use>
</wrap-s>
<wrap-t>
<use>texture[2]/wrap-t</use>
</wrap-t>
<internal-format> <internal-format>
<use>texture[2]/internal-format</use> <use>texture[2]/internal-format</use>
</internal-format> </internal-format>
</texture-unit> </texture-unit>
<program> <program>
<vertex-shader>Shaders/landmass-g.vert</vertex-shader> <vertex-shader n="0">Shaders/include_fog.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>Shaders/landmass.frag</fragment-shader> <fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
<fragment-shader n="1">Shaders/landmass.frag</fragment-shader>
<geometry-vertices-out type="int">18</geometry-vertices-out> <geometry-vertices-out type="int">18</geometry-vertices-out>
<geometry-input-type>triangles</geometry-input-type> <geometry-input-type>triangles</geometry-input-type>
<geometry-output-type>triangle-strip</geometry-output-type> <geometry-output-type>triangle-strip</geometry-output-type>
@ -170,34 +293,85 @@
<uniform> <uniform>
<name>depth_factor</name> <name>depth_factor</name>
<type>float</type> <type>float</type>
<value><use>depth-factor</use></value> <value>
<use>depth-factor</use>
</value>
</uniform> </uniform>
<uniform> <uniform>
<name>snowlevel</name> <name>snowlevel</name>
<type>float</type> <type>float</type>
<value><use>snow-level</use></value> <value>
<use>snow-level</use>
</value>
</uniform> </uniform>
<uniform> <uniform>
<name>canopy_height</name> <name>canopy_height</name>
<type>float</type> <type>float</type>
<value><use>canopy-height</use></value> <value>
<use>canopy-height</use>
</value>
</uniform> </uniform>
<uniform> <uniform>
<name>quality_level</name> <name>quality_level</name>
<type>float</type> <type>float</type>
<value><use>quality-level</use></value> <value>
<use>quality-level</use>
</value>
</uniform> </uniform>
<depth> <depth>
<function>lequal</function> <function>lequal</function>
<write-mask type="bool">false</write-mask> <write-mask type="bool">false</write-mask>
</depth> </depth>
<!-- 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="9"> <technique n="9">
<predicate> <predicate>
<and> <and>
<property>/sim/rendering/landmass-shader</property> <property>/sim/rendering/shaders/landmass</property>
<property>/sim/rendering/shader-effects</property>
<or> <or>
<less-equal> <less-equal>
<value type="float">2.0</value> <value type="float">2.0</value>
@ -215,18 +389,32 @@
<pass> <pass>
<lighting>true</lighting> <lighting>true</lighting>
<material> <material>
<ambient><use>material/ambient</use></ambient> <ambient>
<diffuse><use>material/diffuse</use></diffuse> <use>material/ambient</use>
<specular><use>material/specular</use></specular> </ambient>
<diffuse>
<use>material/diffuse</use>
</diffuse>
<specular>
<use>material/specular</use>
</specular>
<color-mode>ambient-and-diffuse</color-mode> <color-mode>ambient-and-diffuse</color-mode>
</material> </material>
<blend><use>transparent</use></blend> <blend>
<alpha-test><use>transparent</use></alpha-test> <use>transparent</use>
</blend>
<alpha-test>
<use>transparent</use>
</alpha-test>
<shade-model>smooth</shade-model> <shade-model>smooth</shade-model>
<cull-face>back</cull-face> <cull-face>back</cull-face>
<render-bin> <render-bin>
<bin-number><use>render-bin/bin-number</use></bin-number> <bin-number>
<bin-name><use>render-bin/bin-name</use></bin-name> <use>render-bin/bin-number</use>
</bin-number>
<bin-name>
<use>render-bin/bin-name</use>
</bin-name>
</render-bin> </render-bin>
<texture-unit> <texture-unit>
<unit>0</unit> <unit>0</unit>
@ -234,27 +422,45 @@
</texture-unit> </texture-unit>
<texture-unit> <texture-unit>
<unit>1</unit> <unit>1</unit>
<image><use>texture[0]/image</use></image> <image>
<filter><use>texture[0]/filter</use></filter> <use>texture[0]/image</use>
<wrap-s><use>texture[0]/wrap-s</use></wrap-s> </image>
<wrap-t><use>texture[0]/wrap-t</use></wrap-t> <filter>
<use>texture[0]/filter</use>
</filter>
<wrap-s>
<use>texture[0]/wrap-s</use>
</wrap-s>
<wrap-t>
<use>texture[0]/wrap-t</use>
</wrap-t>
<internal-format> <internal-format>
<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>2</unit> <unit>2</unit>
<image><use>texture[2]/image</use></image> <image>
<filter><use>texture[2]/filter</use></filter> <use>texture[2]/image</use>
<wrap-s><use>texture[2]/wrap-s</use></wrap-s> </image>
<wrap-t><use>texture[2]/wrap-t</use></wrap-t> <filter>
<use>texture[2]/filter</use>
</filter>
<wrap-s>
<use>texture[2]/wrap-s</use>
</wrap-s>
<wrap-t>
<use>texture[2]/wrap-t</use>
</wrap-t>
<internal-format> <internal-format>
<use>texture[2]/internal-format</use> <use>texture[2]/internal-format</use>
</internal-format> </internal-format>
</texture-unit> </texture-unit>
<program> <program>
<vertex-shader>Shaders/landmass.vert</vertex-shader> <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader>
<fragment-shader>Shaders/landmass.frag</fragment-shader> <vertex-shader n="1">Shaders/landmass.vert</vertex-shader>
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
<fragment-shader n="1">Shaders/landmass.frag</fragment-shader>
<attribute> <attribute>
<name>tangent</name> <name>tangent</name>
<index>6</index> <index>6</index>
@ -282,18 +488,69 @@
<uniform> <uniform>
<name>depth_factor</name> <name>depth_factor</name>
<type>float</type> <type>float</type>
<value><use>depth-factor</use></value> <value>
<use>depth-factor</use>
</value>
</uniform> </uniform>
<uniform> <uniform>
<name>snowlevel</name> <name>snowlevel</name>
<type>float</type> <type>float</type>
<value><use>snow-level</use></value> <value>
<use>snow-level</use>
</value>
</uniform> </uniform>
<uniform> <uniform>
<name>quality_level</name> <name>quality_level</name>
<type>float</type> <type>float</type>
<value><use>quality-level</use></value> <value>
<use>quality-level</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>
</PropertyList> </PropertyList>