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

@ -1,299 +1,556 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<PropertyList> <PropertyList>
<name>Effects/landmass</name> <name>Effects/landmass</name>
<inherits-from>Effects/terrain-default</inherits-from> <inherits-from>Effects/terrain-default</inherits-from>
<parameters> <parameters>
<texture n="2"> <texture n="2">
<image>Textures.high/Terrain/forest-relief.png</image> <image>Textures.high/Terrain/forest-relief.png</image>
<filter>linear-mipmap-linear</filter> <filter>linear-mipmap-linear</filter>
<wrap-s>repeat</wrap-s> <wrap-s>repeat</wrap-s>
<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>
<depth-factor type="float">0.01</depth-factor> <use>/environment/snow-level-m</use>
<canopy-height type="float">15.0</canopy-height> </snow-level>
<quality-level><use>/sim/rendering/quality-level</use></quality-level> <depth-factor type="float">0.01</depth-factor>
</parameters> <canopy-height type="float">15.0</canopy-height>
<generate> <quality-level>
<tangent type="int">6</tangent> <use>/sim/rendering/shaders/quality-level</use>
<binormal type="int">7</binormal> </quality-level>
</generate> </parameters>
<technique n="8">
<predicate> <!--fog include-->
<and> <visibility>
<property>/sim/rendering/landmass-shader</property> <use>/environment/ground-visibility-m</use>
<property>/sim/rendering/shader-effects</property> </visibility>
<less-equal> <avisibility>
<value type="float">4.5</value> <use>/environment/visibility-m</use>
<float-property>/sim/rendering/quality-level</float-property> </avisibility>
</less-equal> <lthickness>
<or> <use>/environment/ground-haze-thickness-m</use>
<less-equal> </lthickness>
<value type="float">2.0</value> <scattering>
<glversion/> <use>/rendering/scene/scattering</use>
</less-equal> </scattering>
<and> <terminator>
<extension-supported>GL_ARB_shader_objects</extension-supported> <use>/environment/terminator-relative-position-m</use>
<extension-supported>GL_ARB_shading_language_100</extension-supported> </terminator>
<extension-supported>GL_ARB_vertex_shader</extension-supported> <fogtype>
<extension-supported>GL_ARB_fragment_shader</extension-supported> <use>/sim/rendering/scattering-shader</use>
</and> </fogtype>
</or> <!-- END fog include -->
<extension-supported>GL_EXT_geometry_shader4</extension-supported>
</and> <generate>
</predicate> <tangent type="int">6</tangent>
<pass> <binormal type="int">7</binormal>
<lighting>true</lighting> </generate>
<material> <technique n="8">
<ambient><use>material/ambient</use></ambient> <predicate>
<diffuse><use>material/diffuse</use></diffuse> <and>
<specular><use>material/specular</use></specular> <property>/sim/rendering/shaders/landmass</property>
<color-mode>ambient-and-diffuse</color-mode> <less-equal>
</material> <value type="float">4.5</value>
<alpha-test><use>transparent</use></alpha-test> <float-property>/sim/rendering/shaders/quality-level</float-property>
<shade-model>smooth</shade-model> </less-equal>
<cull-face>back</cull-face> <or>
<render-bin> <less-equal>
<bin-number>-1</bin-number> <value type="float">2.0</value>
<bin-name>RenderBin</bin-name> <glversion/>
</render-bin> </less-equal>
<texture-unit> <and>
<unit>1</unit> <extension-supported>GL_ARB_shader_objects</extension-supported>
<image><use>texture[0]/image</use></image> <extension-supported>GL_ARB_shading_language_100</extension-supported>
<filter><use>texture[0]/filter</use></filter> <extension-supported>GL_ARB_vertex_shader</extension-supported>
<wrap-s><use>texture[0]/wrap-s</use></wrap-s> <extension-supported>GL_ARB_fragment_shader</extension-supported>
<wrap-t><use>texture[0]/wrap-t</use></wrap-t> </and>
<internal-format> </or>
<use>texture[0]/internal-format</use> <extension-supported>GL_EXT_geometry_shader4</extension-supported>
</internal-format> </and>
</texture-unit> </predicate>
<program> <pass>
<vertex-shader>Shaders/landmass-g.vert</vertex-shader> <lighting>true</lighting>
<geometry-shader>Shaders/landmass.geom</geometry-shader> <material>
<fragment-shader>Shaders/terrain-nocolor.frag</fragment-shader> <ambient>
<geometry-vertices-out type="int">18</geometry-vertices-out> <use>material/ambient</use>
<geometry-input-type>triangles</geometry-input-type> </ambient>
<geometry-output-type>triangle-strip</geometry-output-type> <diffuse>
<attribute> <use>material/diffuse</use>
<name>tangent</name> </diffuse>
<index>6</index> <specular>
</attribute> <use>material/specular</use>
<attribute> </specular>
<name>binormal</name> <color-mode>ambient-and-diffuse</color-mode>
<index>7</index> </material>
</attribute> <alpha-test>
</program> <use>transparent</use>
<uniform> </alpha-test>
<name>texture</name> <shade-model>smooth</shade-model>
<type>sampler-2d</type> <cull-face>back</cull-face>
<value type="int">1</value> <render-bin>
</uniform> <bin-number>-1</bin-number>
<uniform> <bin-name>RenderBin</bin-name>
<name>canopy_height</name> </render-bin>
<type>float</type> <texture-unit>
<value><use>canopy-height</use></value> <unit>1</unit>
</uniform> <image>
<color-mask type="vec4d">0 0 0 0</color-mask> <use>texture[0]/image</use>
</pass> </image>
<pass> <filter>
<lighting>true</lighting> <use>texture[0]/filter</use>
<material> </filter>
<ambient><use>material/ambient</use></ambient> <wrap-s>
<diffuse><use>material/diffuse</use></diffuse> <use>texture[0]/wrap-s</use>
<specular><use>material/specular</use></specular> </wrap-s>
<color-mode>ambient-and-diffuse</color-mode> <wrap-t>
</material> <use>texture[0]/wrap-t</use>
<blend><use>transparent</use></blend> </wrap-t>
<alpha-test><use>transparent</use></alpha-test> <internal-format>
<shade-model>smooth</shade-model> <use>texture[0]/internal-format</use>
<cull-face>back</cull-face> </internal-format>
<render-bin> </texture-unit>
<bin-number><use>render-bin/bin-number</use></bin-number> <program>
<bin-name><use>render-bin/bin-name</use></bin-name> <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader>
</render-bin> <vertex-shader n="1">Shaders/landmass-g.vert</vertex-shader>
<texture-unit> <geometry-shader>Shaders/landmass.geom</geometry-shader>
<unit>0</unit> <fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
<type>noise</type> <fragment-shader n="1">Shaders/terrain-nocolor.frag</fragment-shader>
</texture-unit> <geometry-vertices-out type="int">18</geometry-vertices-out>
<texture-unit> <geometry-input-type>triangles</geometry-input-type>
<unit>1</unit> <geometry-output-type>triangle-strip</geometry-output-type>
<image><use>texture[0]/image</use></image> <attribute>
<filter><use>texture[0]/filter</use></filter> <name>tangent</name>
<wrap-s><use>texture[0]/wrap-s</use></wrap-s> <index>6</index>
<wrap-t><use>texture[0]/wrap-t</use></wrap-t> </attribute>
<internal-format> <attribute>
<use>texture[0]/internal-format</use> <name>binormal</name>
</internal-format> <index>7</index>
</texture-unit> </attribute>
<texture-unit> </program>
<unit>2</unit> <uniform>
<image><use>texture[2]/image</use></image> <name>texture</name>
<filter><use>texture[2]/filter</use></filter> <type>sampler-2d</type>
<wrap-s><use>texture[2]/wrap-s</use></wrap-s> <value type="int">1</value>
<wrap-t><use>texture[2]/wrap-t</use></wrap-t> </uniform>
<internal-format> <uniform>
<use>texture[2]/internal-format</use> <name>canopy_height</name>
</internal-format> <type>float</type>
</texture-unit> <value>
<program> <use>canopy-height</use>
<vertex-shader>Shaders/landmass-g.vert</vertex-shader> </value>
<geometry-shader>Shaders/landmass.geom</geometry-shader> </uniform>
<fragment-shader>Shaders/landmass.frag</fragment-shader> <color-mask type="vec4d">0 0 0 0</color-mask>
<geometry-vertices-out type="int">18</geometry-vertices-out>
<geometry-input-type>triangles</geometry-input-type> <!-- BEGIN fog include -->
<geometry-output-type>triangle-strip</geometry-output-type> <uniform>
<attribute> <name>visibility</name>
<name>tangent</name> <type>float</type>
<index>6</index> <value>
</attribute> <use>visibility</use>
<attribute> </value>
<name>binormal</name> </uniform>
<index>7</index> <uniform>
</attribute> <name>avisibility</name>
</program> <type>float</type>
<uniform> <value>
<name>NoiseTex</name> <use>avisibility</use>
<type>sampler-3d</type> </value>
<value type="int">0</value> </uniform>
</uniform> <uniform>
<uniform> <name>hazeLayerAltitude</name>
<name>BaseTex</name> <type>float</type>
<type>sampler-2d</type> <value>
<value type="int">1</value> <use>lthickness</use>
</uniform> </value>
<uniform> </uniform>
<name>NormalTex</name> <uniform>
<type>sampler-2d</type> <name>scattering</name>
<value type="int">2</value> <type>float</type>
</uniform> <value>
<uniform> <use>scattering</use>
<name>depth_factor</name> </value>
<type>float</type> </uniform>
<value><use>depth-factor</use></value> <uniform>
</uniform> <name>terminator</name>
<uniform> <type>float</type>
<name>snowlevel</name> <value>
<type>float</type> <use>terminator</use>
<value><use>snow-level</use></value> </value>
</uniform> </uniform>
<uniform> <uniform>
<name>canopy_height</name> <name>fogType</name>
<type>float</type> <type>int</type>
<value><use>canopy-height</use></value> <value>
</uniform> <use>fogtype</use>
<uniform> </value>
<name>quality_level</name> </uniform>
<type>float</type> <!-- END fog include -->
<value><use>quality-level</use></value>
</uniform> </pass>
<depth> <pass>
<function>lequal</function> <lighting>true</lighting>
<write-mask type="bool">false</write-mask> <material>
</depth> <ambient>
</pass> <use>material/ambient</use>
</technique> </ambient>
<technique n="9"> <diffuse>
<predicate> <use>material/diffuse</use>
<and> </diffuse>
<property>/sim/rendering/landmass-shader</property> <specular>
<property>/sim/rendering/shader-effects</property> <use>material/specular</use>
<or> </specular>
<less-equal> <color-mode>ambient-and-diffuse</color-mode>
<value type="float">2.0</value> </material>
<glversion/> <blend>
</less-equal> <use>transparent</use>
<and> </blend>
<extension-supported>GL_ARB_shader_objects</extension-supported> <alpha-test>
<extension-supported>GL_ARB_shading_language_100</extension-supported> <use>transparent</use>
<extension-supported>GL_ARB_vertex_shader</extension-supported> </alpha-test>
<extension-supported>GL_ARB_fragment_shader</extension-supported> <shade-model>smooth</shade-model>
</and> <cull-face>back</cull-face>
</or> <render-bin>
</and> <bin-number>
</predicate> <use>render-bin/bin-number</use>
<pass> </bin-number>
<lighting>true</lighting> <bin-name>
<material> <use>render-bin/bin-name</use>
<ambient><use>material/ambient</use></ambient> </bin-name>
<diffuse><use>material/diffuse</use></diffuse> </render-bin>
<specular><use>material/specular</use></specular> <texture-unit>
<color-mode>ambient-and-diffuse</color-mode> <unit>0</unit>
</material> <type>noise</type>
<blend><use>transparent</use></blend> </texture-unit>
<alpha-test><use>transparent</use></alpha-test> <texture-unit>
<shade-model>smooth</shade-model> <unit>1</unit>
<cull-face>back</cull-face> <image>
<render-bin> <use>texture[0]/image</use>
<bin-number><use>render-bin/bin-number</use></bin-number> </image>
<bin-name><use>render-bin/bin-name</use></bin-name> <filter>
</render-bin> <use>texture[0]/filter</use>
<texture-unit> </filter>
<unit>0</unit> <wrap-s>
<type>noise</type> <use>texture[0]/wrap-s</use>
</texture-unit> </wrap-s>
<texture-unit> <wrap-t>
<unit>1</unit> <use>texture[0]/wrap-t</use>
<image><use>texture[0]/image</use></image> </wrap-t>
<filter><use>texture[0]/filter</use></filter> <internal-format>
<wrap-s><use>texture[0]/wrap-s</use></wrap-s> <use>texture[0]/internal-format</use>
<wrap-t><use>texture[0]/wrap-t</use></wrap-t> </internal-format>
<internal-format> </texture-unit>
<use>texture[0]/internal-format</use> <texture-unit>
</internal-format> <unit>2</unit>
</texture-unit> <image>
<texture-unit> <use>texture[2]/image</use>
<unit>2</unit> </image>
<image><use>texture[2]/image</use></image> <filter>
<filter><use>texture[2]/filter</use></filter> <use>texture[2]/filter</use>
<wrap-s><use>texture[2]/wrap-s</use></wrap-s> </filter>
<wrap-t><use>texture[2]/wrap-t</use></wrap-t> <wrap-s>
<internal-format> <use>texture[2]/wrap-s</use>
<use>texture[2]/internal-format</use> </wrap-s>
</internal-format> <wrap-t>
</texture-unit> <use>texture[2]/wrap-t</use>
<program> </wrap-t>
<vertex-shader>Shaders/landmass.vert</vertex-shader> <internal-format>
<fragment-shader>Shaders/landmass.frag</fragment-shader> <use>texture[2]/internal-format</use>
<attribute> </internal-format>
<name>tangent</name> </texture-unit>
<index>6</index> <program>
</attribute> <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader>
<attribute> <vertex-shader n="1">Shaders/landmass-g.vert</vertex-shader>
<name>binormal</name> <geometry-shader>Shaders/landmass.geom</geometry-shader>
<index>7</index> <fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
</attribute> <fragment-shader n="1">Shaders/landmass.frag</fragment-shader>
</program> <geometry-vertices-out type="int">18</geometry-vertices-out>
<uniform> <geometry-input-type>triangles</geometry-input-type>
<name>NoiseTex</name> <geometry-output-type>triangle-strip</geometry-output-type>
<type>sampler-3d</type> <attribute>
<value type="int">0</value> <name>tangent</name>
</uniform> <index>6</index>
<uniform> </attribute>
<name>BaseTex</name> <attribute>
<type>sampler-2d</type> <name>binormal</name>
<value type="int">1</value> <index>7</index>
</uniform> </attribute>
<uniform> </program>
<name>NormalTex</name> <uniform>
<type>sampler-2d</type> <name>NoiseTex</name>
<value type="int">2</value> <type>sampler-3d</type>
</uniform> <value type="int">0</value>
<uniform> </uniform>
<name>depth_factor</name> <uniform>
<type>float</type> <name>BaseTex</name>
<value><use>depth-factor</use></value> <type>sampler-2d</type>
</uniform> <value type="int">1</value>
<uniform> </uniform>
<name>snowlevel</name> <uniform>
<type>float</type> <name>NormalTex</name>
<value><use>snow-level</use></value> <type>sampler-2d</type>
</uniform> <value type="int">2</value>
<uniform> </uniform>
<name>quality_level</name> <uniform>
<type>float</type> <name>depth_factor</name>
<value><use>quality-level</use></value> <type>float</type>
</uniform> <value>
</pass> <use>depth-factor</use>
</technique> </value>
</uniform>
<uniform>
<name>snowlevel</name>
<type>float</type>
<value>
<use>snow-level</use>
</value>
</uniform>
<uniform>
<name>canopy_height</name>
<type>float</type>
<value>
<use>canopy-height</use>
</value>
</uniform>
<uniform>
<name>quality_level</name>
<type>float</type>
<value>
<use>quality-level</use>
</value>
</uniform>
<depth>
<function>lequal</function>
<write-mask type="bool">false</write-mask>
</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>
</technique>
<technique n="9">
<predicate>
<and>
<property>/sim/rendering/shaders/landmass</property>
<or>
<less-equal>
<value type="float">2.0</value>
<glversion/>
</less-equal>
<and>
<extension-supported>GL_ARB_shader_objects</extension-supported>
<extension-supported>GL_ARB_shading_language_100</extension-supported>
<extension-supported>GL_ARB_vertex_shader</extension-supported>
<extension-supported>GL_ARB_fragment_shader</extension-supported>
</and>
</or>
</and>
</predicate>
<pass>
<lighting>true</lighting>
<material>
<ambient>
<use>material/ambient</use>
</ambient>
<diffuse>
<use>material/diffuse</use>
</diffuse>
<specular>
<use>material/specular</use>
</specular>
<color-mode>ambient-and-diffuse</color-mode>
</material>
<blend>
<use>transparent</use>
</blend>
<alpha-test>
<use>transparent</use>
</alpha-test>
<shade-model>smooth</shade-model>
<cull-face>back</cull-face>
<render-bin>
<bin-number>
<use>render-bin/bin-number</use>
</bin-number>
<bin-name>
<use>render-bin/bin-name</use>
</bin-name>
</render-bin>
<texture-unit>
<unit>0</unit>
<type>noise</type>
</texture-unit>
<texture-unit>
<unit>1</unit>
<image>
<use>texture[0]/image</use>
</image>
<filter>
<use>texture[0]/filter</use>
</filter>
<wrap-s>
<use>texture[0]/wrap-s</use>
</wrap-s>
<wrap-t>
<use>texture[0]/wrap-t</use>
</wrap-t>
<internal-format>
<use>texture[0]/internal-format</use>
</internal-format>
</texture-unit>
<texture-unit>
<unit>2</unit>
<image>
<use>texture[2]/image</use>
</image>
<filter>
<use>texture[2]/filter</use>
</filter>
<wrap-s>
<use>texture[2]/wrap-s</use>
</wrap-s>
<wrap-t>
<use>texture[2]/wrap-t</use>
</wrap-t>
<internal-format>
<use>texture[2]/internal-format</use>
</internal-format>
</texture-unit>
<program>
<vertex-shader n="0">Shaders/include_fog.vert</vertex-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>
<name>tangent</name>
<index>6</index>
</attribute>
<attribute>
<name>binormal</name>
<index>7</index>
</attribute>
</program>
<uniform>
<name>NoiseTex</name>
<type>sampler-3d</type>
<value type="int">0</value>
</uniform>
<uniform>
<name>BaseTex</name>
<type>sampler-2d</type>
<value type="int">1</value>
</uniform>
<uniform>
<name>NormalTex</name>
<type>sampler-2d</type>
<value type="int">2</value>
</uniform>
<uniform>
<name>depth_factor</name>
<type>float</type>
<value>
<use>depth-factor</use>
</value>
</uniform>
<uniform>
<name>snowlevel</name>
<type>float</type>
<value>
<use>snow-level</use>
</value>
</uniform>
<uniform>
<name>quality_level</name>
<type>float</type>
<value>
<use>quality-level</use>
</value>
</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>
</technique>
</PropertyList> </PropertyList>