1
0
Fork 0

Add new effects in support of .dds textures

Signed-off-by: Vivian Meazza <vivian.meazza@lineone.net>
This commit is contained in:
Vivian Meazza 2011-09-05 16:05:59 +01:00
parent 062594ff05
commit c06d1a7710
6 changed files with 590 additions and 0 deletions

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<name>Effects/transition-base-dirt</name>
<inherits-from>Effects/transition</inherits-from>
<parameters>
<texture n="3">
<image>Textures.high/Terrain/dirt3.dds</image>
<filter>linear-mipmap-linear</filter>
<wrap-s>repeat</wrap-s>
<wrap-t>repeat</wrap-t>
<internal-format>normalized</internal-format>
</texture>
<transitions type="float">1.0</transitions>
<inverse type="float">0.0</inverse>
</parameters>
</PropertyList>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<name>Effects/transition-base-rock</name>
<inherits-from>Effects/transition</inherits-from>
<parameters>
<texture n="3">
<image>Textures.high/Terrain/grass12.dds</image>
<filter>linear-mipmap-linear</filter>
<wrap-s>repeat</wrap-s>
<wrap-t>repeat</wrap-t>
<internal-format>normalized</internal-format>
</texture>
<transitions type="float">1.0</transitions>
<inverse type="float">1.0</inverse>
</parameters>
</PropertyList>

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<name>Effects/transition-base-grass-rock</name>
<inherits-from>Effects/transition</inherits-from>
<parameters>
<texture n="2">
<image>Textures.high/Terrain/grass10c.dds</image>
<filter>linear-mipmap-linear</filter>
<wrap-s>repeat</wrap-s>
<wrap-t>repeat</wrap-t>
<internal-format>normalized</internal-format>
</texture>
<texture n="3">
<image>Textures.high/Terrain/rock7.dds</image>
<filter>linear-mipmap-linear</filter>
<wrap-s>repeat</wrap-s>
<wrap-t>repeat</wrap-t>
<internal-format>normalized</internal-format>
</texture>
<texture n="4">
<image>Textures.high/Terrain.winter/mixedforest1c.dds</image>
<filter>linear-mipmap-linear</filter>
<wrap-s>repeat</wrap-s>
<wrap-t>repeat</wrap-t>
<internal-format>normalized</internal-format>
</texture>
<transitions type="float">2.0</transitions>
<inverse type="float">0.0</inverse>
</parameters>
</PropertyList>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<name>Effects/transition-base-rock</name>
<inherits-from>Effects/transition</inherits-from>
<parameters>
<texture n="3">
<image>Textures.high/Terrain/rock7.dds</image>
<filter>linear-mipmap-linear</filter>
<wrap-s>repeat</wrap-s>
<wrap-t>repeat</wrap-t>
<internal-format>normalized</internal-format>
</texture>
<transitions type="float">1.0</transitions>
<inverse type="float">0.0</inverse>
</parameters>
</PropertyList>

262
Effects/transition.eff Normal file
View file

@ -0,0 +1,262 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Transition effect starting from the base texture of the scenery, and changing textures according to slope in one or two steps.
parameters :
texture[0] -> base texture from the scenery
texture[2] -> intermediate texture if transitions is set to 2
texture[3] -> texture you want to transition to
texture[4] -> snow texture you want applied above snow-limit (I recommend using the corespondent winter texture for the base texture that you can find in terrain.winter)
transitions -> transitions number can be set to 1 or 2 (if set to 2 will allow for an intermediate step)
inverse -> if this is se to 1 will keep the base texture on steep slopes and transition to the texture you want (useful to add some grass patches in rocky areas)
-->
<PropertyList>
<name>Effects/transition</name>
<inherits-from>Effects/terrain-default</inherits-from>
<parameters>
<texture n="2">
<image>Textures.high/Terrain/transition1.dds</image>
<filter>linear-mipmap-linear</filter>
<wrap-s>repeat</wrap-s>
<wrap-t>repeat</wrap-t>
<internal-format>normalized</internal-format>
</texture>
<texture n="3">
<image>Textures.high/Terrain/transition2.dds</image>
<filter>linear-mipmap-linear</filter>
<wrap-s>repeat</wrap-s>
<wrap-t>repeat</wrap-t>
<internal-format>normalized</internal-format>
</texture>
<texture n="4">
<image>Textures.high/Terrain/snow3.dds</image>
<filter>linear-mipmap-linear</filter>
<wrap-s>repeat</wrap-s>
<wrap-t>repeat</wrap-t>
<internal-format>normalized</internal-format>
</texture>
<rain-norm>
<use>/environment/rain-norm</use>
</rain-norm>
<snow-level>
<use>/sim/rendering/snow-level-m</use>
</snow-level>
<transitions type="float">2.0</transitions>
<inverse type="float">0.0</inverse>
</parameters>
<!--<generate>
<tangent type="int">6</tangent>
<binormal type="int">7</binormal>
</generate>-->
<technique n="9">
<predicate>
<and>
<property>/sim/rendering/transition-shader</property>
<property>/sim/rendering/shader-effects</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>
<!-- Use material values that are either inherited from the
terrain-default effect or supplied by an effect derived
from this one e.g., one created in the materials library. -->
<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>
<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>1</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>
<texture-unit>
<unit>2</unit>
<image>
<use>texture[3]/image</use>
</image>
<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>
<use>texture[3]/internal-format</use>
</internal-format>
</texture-unit>
<texture-unit>
<unit>3</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>
<texture-unit>
<unit>4</unit>
<type>noise</type>
</texture-unit>
<program>
<vertex-shader>Shaders/transition.vert</vertex-shader>
<fragment-shader>Shaders/transition.frag</fragment-shader>
</program>
<uniform>
<name>BaseTex</name>
<type>sampler-2d</type>
<value type="int">0</value>
</uniform>
<uniform>
<name>SecondTex</name>
<type>sampler-2d</type>
<value type="int">1</value>
</uniform>
<uniform>
<name>ThirdTex</name>
<type>sampler-2d</type>
<value type="int">2</value>
</uniform>
<uniform>
<name>SnowTex</name>
<type>sampler-2d</type>
<value type="int">3</value>
</uniform>
<uniform>
<name>NoiseTex</name>
<type>sampler-3d</type>
<value type="int">4</value>
</uniform>
<uniform>
<name>RainNorm</name>
<type>float</type>
<value>
<use>rain-norm</use>
</value>
</uniform>
<uniform>
<name>SnowLevel</name>
<type>float</type>
<value>
<use>snow-level</use>
</value>
</uniform>
<uniform>
<name>Transitions</name>
<type>float</type>
<value>
<use>transitions</use>
</value>
</uniform>
<uniform>
<name>InverseSlope</name>
<type>float</type>
<value>
<use>inverse</use>
</value>
</uniform>
</pass>
</technique>
</PropertyList>

246
Effects/water-inland.eff Normal file
View file

@ -0,0 +1,246 @@
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<name>Effects/water-inland</name>
<inherits-from>Effects/terrain-default</inherits-from>
<parameters>
<texture n="0">
<image>Textures/Water/water-reflection-inland.dds</image>
<filter>linear-mipmap-linear</filter>
<wrap-s>repeat</wrap-s>
<wrap-t>repeat</wrap-t>
<internal-format>normalized</internal-format>
</texture>
<texture n="2">
<image>Textures/Water/water-normalmap.png</image>
<filter>linear-mipmap-linear</filter>
<wrap-s>repeat</wrap-s>
<wrap-t>repeat</wrap-t>
<internal-format>normalized</internal-format>
</texture>
<texture n="3">
<image>Textures/Water/water-dudv.png</image>
<filter>linear-mipmap-linear</filter>
<wrap-s>repeat</wrap-s>
<wrap-t>repeat</wrap-t>
<internal-format>normalized</internal-format>
</texture>
<saturation>
<use>/rendering/scene/saturation</use>
</saturation>
<rain-norm>
<use>/environment/rain-norm</use>
</rain-norm>
</parameters>
<technique n="8">
<predicate>
<and>
<property>/sim/rendering/water-shader</property>
<property>/sim/rendering/shader-effects</property>
<less-equal>
<value type="float">2.0</value>
<float-property>/sim/rendering/quality-level</float-property>
</less-equal>
<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>
<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>
<texture-unit>
<unit>3</unit>
<image>
<use>texture[3]/image</use>
</image>
<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>
<use>texture[3]/internal-format</use>
</internal-format>
</texture-unit>
<program>
<vertex-shader>Shaders/water.vert</vertex-shader>
<fragment-shader>Shaders/water-inland.frag</fragment-shader>
</program>
<uniform>
<name>water_reflection</name>
<type>sampler-2d</type>
<value type="int">0</value>
</uniform>
<uniform>
<name>water_normalmap</name>
<type>sampler-2d</type>
<value type="int">2</value>
</uniform>
<uniform>
<name>water_dudvmap</name>
<type>sampler-2d</type>
<value type="int">3</value>
</uniform>
<uniform>
<name>saturation</name>
<type>float</type>
<!--<value>0.4</value>-->
<value>
<use>saturation</use>
</value>
</uniform>
<uniform>
<name>RainNorm</name>
<type>float</type>
<!--<value>0.0</value>-->
<value>
<use>rain-norm</use>
</value>
</uniform>
</pass>
</technique>
<technique n="9">
<predicate>
<and>
<property>/sim/rendering/water-shader</property>
<property>/sim/rendering/shader-effects</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>
<program>
<vertex-shader>Shaders/water-orig.vert</vertex-shader>
<fragment-shader>Shaders/water-orig.frag</fragment-shader>
</program>
<uniform>
<name>texture</name>
<type>sampler-3d</type>
<value type="int">0</value>
</uniform>
</pass>
</technique>
</PropertyList>