1
0
Fork 0

Update effect to use modified shader

Signed-off-by: Vivian Meazza <vivian.meazza@lineone.net>
This commit is contained in:
Vivian Meazza 2011-09-22 14:41:08 +01:00
parent 980c1d7926
commit ee01294e6e
3 changed files with 441 additions and 188 deletions

View file

@ -43,6 +43,23 @@ parameters :
<snow-level> <snow-level>
<use>/sim/rendering/snow-level-m</use> <use>/sim/rendering/snow-level-m</use>
</snow-level> </snow-level>
<cloud-cover0>
<use>/environment/clouds/layer[0]/coverage-type</use>
</cloud-cover0>
<cloud-cover1>
<use>/environment/clouds/layer[1]/coverage-type</use>
</cloud-cover1>
<cloud-cover2>
<use>/environment/clouds/layer[2]/coverage-type</use>
</cloud-cover2>
<cloud-cover3>
<use>/environment/clouds/layer[3]/coverage-type</use>
</cloud-cover3>
<cloud-cover4>
<use>/environment/clouds/layer[4]/coverage-type</use>
</cloud-cover4>
<transitions type="float">2.0</transitions> <transitions type="float">2.0</transitions>
<inverse type="float">0.0</inverse> <inverse type="float">0.0</inverse>
</parameters> </parameters>
@ -257,6 +274,46 @@ parameters :
<use>inverse</use> <use>inverse</use>
</value> </value>
</uniform> </uniform>
<uniform>
<name>CloudCover0</name>
<type>float</type>
<value>
<use>cloud-cover0</use>
</value>
</uniform>
<uniform>
<name>CloudCover1</name>
<type>float</type>
<value>
<use>cloud-cover1</use>
</value>
</uniform>
<uniform>
<name>CloudCover2</name>
<type>float</type>
<value>
<use>cloud-cover2</use>
</value>
</uniform>
<uniform>
<name>CloudCover3</name>
<type>float</type>
<value>
<use>cloud-cover3</use>
</value>
</uniform>
<uniform>
<name>CloudCover4</name>
<type>float</type>
<value>
<use>cloud-cover4</use>
</value>
</uniform>
</pass> </pass>
</technique> </technique>
</PropertyList> </PropertyList>

View file

@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<PropertyList> <PropertyList>
<name>Effects/water-inland</name> <name>Effects/water</name>
<inherits-from>Effects/terrain-default</inherits-from> <inherits-from>Effects/terrain-default</inherits-from>
<parameters> <parameters>
<texture n="0"> <texture n="0">
<image>Textures/Water/water-reflection-inland.dds</image> <image>Textures/Water/water-reflection-inland.dds</image>
@ -26,14 +24,32 @@
<wrap-t>repeat</wrap-t> <wrap-t>repeat</wrap-t>
<internal-format>normalized</internal-format> <internal-format>normalized</internal-format>
</texture> </texture>
<texture n="4">
<image>Textures/Water/water-reflection-grey.png</image>
<filter>linear-mipmap-linear</filter>
<wrap-s>repeat</wrap-s>
<wrap-t>repeat</wrap-t>
<internal-format>normalized</internal-format>
</texture>
<saturation> <saturation>
<use>/rendering/scene/saturation</use> <use>/rendering/scene/saturation</use>
</saturation> </saturation>
<rain-norm> <cloud-cover0>
<use>/environment/rain-norm</use> <use>/environment/clouds/layer[0]/coverage-type</use>
</rain-norm> </cloud-cover0>
<cloud-cover1>
<use>/environment/clouds/layer[1]/coverage-type</use>
</cloud-cover1>
<cloud-cover2>
<use>/environment/clouds/layer[2]/coverage-type</use>
</cloud-cover2>
<cloud-cover3>
<use>/environment/clouds/layer[3]/coverage-type</use>
</cloud-cover3>
<cloud-cover4>
<use>/environment/clouds/layer[4]/coverage-type</use>
</cloud-cover4>
</parameters> </parameters>
<technique n="8"> <technique n="8">
<predicate> <predicate>
<and> <and>
@ -141,6 +157,24 @@
<use>texture[3]/internal-format</use> <use>texture[3]/internal-format</use>
</internal-format> </internal-format>
</texture-unit> </texture-unit>
<texture-unit>
<unit>4</unit>
<image>
<use>texture[4]/image</use>
</image>
<filter>
<use>texture[4]/filter</use>
</filter>
<wrap-s>
<use>texture[4]/wrap-s</use>
</wrap-s>
<wrap-t>
<use>texture[4]/wrap-t</use>
</wrap-t>
<internal-format>
<use>texture[4]/internal-format</use>
</internal-format>
</texture-unit>
<program> <program>
<vertex-shader>Shaders/water.vert</vertex-shader> <vertex-shader>Shaders/water.vert</vertex-shader>
<fragment-shader>Shaders/water-inland.frag</fragment-shader> <fragment-shader>Shaders/water-inland.frag</fragment-shader>
@ -160,25 +194,54 @@
<type>sampler-2d</type> <type>sampler-2d</type>
<value type="int">3</value> <value type="int">3</value>
</uniform> </uniform>
<uniform>
<name>water_reflection_grey</name>
<type>sampler-2d</type>
<value type="int">4</value>
</uniform>
<uniform> <uniform>
<name>saturation</name> <name>saturation</name>
<type>float</type> <type>float</type>
<!--<value>0.4</value>--> <value>0.4</value>
<!--<value><use>saturation</use></value>-->
</uniform>
<uniform>
<name>CloudCover0</name>
<type>float</type>
<value> <value>
<use>saturation</use> <use>cloud-cover0</use>
</value> </value>
</uniform> </uniform>
<uniform> <uniform>
<name>RainNorm</name> <name>CloudCover1</name>
<type>float</type> <type>float</type>
<!--<value>0.0</value>-->
<value> <value>
<use>rain-norm</use> <use>cloud-cover1</use>
</value>
</uniform>
<uniform>
<name>CloudCover2</name>
<type>float</type>
<value>
<use>cloud-cover2</use>
</value>
</uniform>
<uniform>
<name>CloudCover3</name>
<type>float</type>
<value>
<use>cloud-cover3</use>
</value>
</uniform>
<uniform>
<name>CloudCover4</name>
<type>float</type>
<value>
<use>cloud-cover4</use>
</value> </value>
</uniform> </uniform>
</pass> </pass>
</technique> </technique>
<technique n="9"> <technique n="9">
<predicate> <predicate>
<and> <and>

View file

@ -24,9 +24,31 @@
<wrap-t>repeat</wrap-t> <wrap-t>repeat</wrap-t>
<internal-format>normalized</internal-format> <internal-format>normalized</internal-format>
</texture> </texture>
<texture n="4">
<image>Textures/Water/water-reflection-grey.png</image>
<filter>linear-mipmap-linear</filter>
<wrap-s>repeat</wrap-s>
<wrap-t>repeat</wrap-t>
<internal-format>normalized</internal-format>
</texture>
<saturation> <saturation>
<use>/rendering/scene/saturation</use> <use>/rendering/scene/saturation</use>
</saturation> </saturation>
<cloud-cover0>
<use>/environment/clouds/layer[0]/coverage-type</use>
</cloud-cover0>
<cloud-cover1>
<use>/environment/clouds/layer[1]/coverage-type</use>
</cloud-cover1>
<cloud-cover2>
<use>/environment/clouds/layer[2]/coverage-type</use>
</cloud-cover2>
<cloud-cover3>
<use>/environment/clouds/layer[3]/coverage-type</use>
</cloud-cover3>
<cloud-cover4>
<use>/environment/clouds/layer[4]/coverage-type</use>
</cloud-cover4>
</parameters> </parameters>
<technique n="8"> <technique n="8">
<predicate> <predicate>
@ -54,49 +76,105 @@
<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>
<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>
<texture-unit> <texture-unit>
<unit>3</unit> <unit>3</unit>
<image><use>texture[3]/image</use></image> <image>
<filter><use>texture[3]/filter</use></filter> <use>texture[3]/image</use>
<wrap-s><use>texture[3]/wrap-s</use></wrap-s> </image>
<wrap-t><use>texture[3]/wrap-t</use></wrap-t> <filter>
<use>texture[3]/filter</use>
</filter>
<wrap-s>
<use>texture[3]/wrap-s</use>
</wrap-s>
<wrap-t>
<use>texture[3]/wrap-t</use>
</wrap-t>
<internal-format> <internal-format>
<use>texture[3]/internal-format</use> <use>texture[3]/internal-format</use>
</internal-format> </internal-format>
</texture-unit> </texture-unit>
<texture-unit>
<unit>4</unit>
<image>
<use>texture[4]/image</use>
</image>
<filter>
<use>texture[4]/filter</use>
</filter>
<wrap-s>
<use>texture[4]/wrap-s</use>
</wrap-s>
<wrap-t>
<use>texture[4]/wrap-t</use>
</wrap-t>
<internal-format>
<use>texture[4]/internal-format</use>
</internal-format>
</texture-unit>
<program> <program>
<vertex-shader>Shaders/water.vert</vertex-shader> <vertex-shader>Shaders/water.vert</vertex-shader>
<fragment-shader>Shaders/water.frag</fragment-shader> <fragment-shader>Shaders/water.frag</fragment-shader>
@ -116,12 +194,52 @@
<type>sampler-2d</type> <type>sampler-2d</type>
<value type="int">3</value> <value type="int">3</value>
</uniform> </uniform>
<uniform>
<name>water_reflection_grey</name>
<type>sampler-2d</type>
<value type="int">4</value>
</uniform>
<uniform> <uniform>
<name>saturation</name> <name>saturation</name>
<type>float</type> <type>float</type>
<value>0.4</value> <value>0.4</value>
<!--<value><use>saturation</use></value>--> <!--<value><use>saturation</use></value>-->
</uniform> </uniform>
<uniform>
<name>CloudCover0</name>
<type>float</type>
<value>
<use>cloud-cover0</use>
</value>
</uniform>
<uniform>
<name>CloudCover1</name>
<type>float</type>
<value>
<use>cloud-cover1</use>
</value>
</uniform>
<uniform>
<name>CloudCover2</name>
<type>float</type>
<value>
<use>cloud-cover2</use>
</value>
</uniform>
<uniform>
<name>CloudCover3</name>
<type>float</type>
<value>
<use>cloud-cover3</use>
</value>
</uniform>
<uniform>
<name>CloudCover4</name>
<type>float</type>
<value>
<use>cloud-cover4</use>
</value>
</uniform>
</pass> </pass>
</technique> </technique>
<technique n="9"> <technique n="9">
@ -146,18 +264,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>
@ -170,7 +302,8 @@
<uniform> <uniform>
<name>texture</name> <name>texture</name>
<type>sampler-3d</type> <type>sampler-3d</type>
<value type="int">0</value></uniform> <value type="int">0</value>
</uniform>
</pass> </pass>
</technique> </technique>
</PropertyList> </PropertyList>