Ubershader fixes
Signed-off-by: Emilian Huminiuc <emilianh@gmail.com>
This commit is contained in:
parent
bb0f79d4ef
commit
72c876aec6
6 changed files with 643 additions and 639 deletions
|
@ -289,7 +289,7 @@
|
|||
</pass>
|
||||
</technique>
|
||||
|
||||
<technique n="8">
|
||||
<!-- <technique n="8">
|
||||
<pass>
|
||||
<texture-unit n="4">
|
||||
<unit>4</unit>
|
||||
|
@ -313,7 +313,7 @@
|
|||
<vertex-shader n="1">Shaders/building-ubershader.vert</vertex-shader>
|
||||
</program>
|
||||
</pass>
|
||||
</technique>
|
||||
</technique>-->
|
||||
|
||||
<technique n="9">
|
||||
<pass>
|
||||
|
|
|
@ -303,7 +303,7 @@ the objects that use it, and replaces it with the default shader.
|
|||
|
||||
<uniform>
|
||||
<name>nmap_tile</name>
|
||||
<type>int</type>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>normalmap-tiling</use>
|
||||
</value>
|
||||
|
|
|
@ -110,4 +110,617 @@ and fallback to plain transparency when the model shader is disabled.
|
|||
-->
|
||||
</pass>
|
||||
</technique>
|
||||
|
||||
<!-- Rembrandt rendering -->
|
||||
<technique n="8">
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/model</property>
|
||||
<property>/sim/rendering/rembrandt/enabled</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>
|
||||
<depth>
|
||||
<write-mask type="bool">false</write-mask>
|
||||
</depth>
|
||||
<material>
|
||||
<active>
|
||||
<use>material/active</use>
|
||||
</active>
|
||||
<ambient>
|
||||
<use>material/ambient</use>
|
||||
</ambient>
|
||||
<diffuse>
|
||||
<use>material/diffuse</use>
|
||||
</diffuse>
|
||||
<specular>
|
||||
<use>material/specular</use>
|
||||
</specular>
|
||||
<emissive>
|
||||
<use>material/emissive</use>
|
||||
</emissive>
|
||||
<shininess>
|
||||
<use>material/shininess</use>
|
||||
</shininess>
|
||||
<color-mode>
|
||||
<use>material/color-mode</use>
|
||||
</color-mode>
|
||||
</material>
|
||||
<blend>
|
||||
<active>
|
||||
<use>blend/active</use>
|
||||
</active>
|
||||
<source>
|
||||
<use>blend/source</use>
|
||||
</source>
|
||||
<destination>
|
||||
<use>blend/destination</use>
|
||||
</destination>
|
||||
</blend>
|
||||
<shade-model>
|
||||
<use>shade-model</use>
|
||||
</shade-model>
|
||||
<cull-face>
|
||||
<use>cull-face</use>
|
||||
</cull-face>
|
||||
<rendering-hint>
|
||||
<use>rendering-hint</use>
|
||||
</rendering-hint>
|
||||
<blend>
|
||||
<use>transparent</use>
|
||||
</blend>
|
||||
<alpha-test>
|
||||
<use>transparent</use>
|
||||
</alpha-test>
|
||||
<render-bin>
|
||||
<bin-number>111</bin-number>
|
||||
<bin-name>DepthSortedBin</bin-name>
|
||||
</render-bin>
|
||||
<!-- Diffuse texture unit-->
|
||||
<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>
|
||||
<!-- Reflection Noise texture unit-->
|
||||
<texture-unit>
|
||||
<unit>1</unit>
|
||||
<type>noise</type>
|
||||
</texture-unit>
|
||||
<!-- NormalMap 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>
|
||||
<!-- LightMap 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>
|
||||
<!-- ReflectMap 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>
|
||||
<!-- Reflection CubeMap texture unit-->
|
||||
<texture-unit>
|
||||
<unit>5</unit>
|
||||
<type>
|
||||
<use>texture[5]/type</use>
|
||||
</type>
|
||||
<!-- use this form for a cube cross -->
|
||||
<!--<image>
|
||||
<use>texture[5]/image</use>
|
||||
</image>-->
|
||||
<!-- END CubeCross -->
|
||||
<!-- use this form for a 6 image cube map -->
|
||||
<images>
|
||||
<use>texture[5]/images</use>
|
||||
</images>
|
||||
<!-- END 6 image cube map -->
|
||||
</texture-unit>
|
||||
<!-- Reflection fresnel texture unit-->
|
||||
<texture-unit>
|
||||
<unit>6</unit>
|
||||
<image>
|
||||
<use>texture[6]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[6]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[6]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[6]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[6]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<!-- Reflection rainbow texture unit-->
|
||||
<texture-unit>
|
||||
<unit>7</unit>
|
||||
<image>
|
||||
<use>texture[7]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[7]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[7]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[7]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[7]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
|
||||
|
||||
<vertex-program-two-side>
|
||||
<use>vertex-program-two-side</use>
|
||||
</vertex-program-two-side>
|
||||
|
||||
<program>
|
||||
<!-- <vertex-shader n="0">Shaders/include_fog.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="1">Shaders/ubershader.frag</fragment-shader>
|
||||
<!--<attribute>
|
||||
<name>tangent</name>
|
||||
<index>6</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>binormal</name>
|
||||
<index>7</index>
|
||||
</attribute>-->
|
||||
</program>
|
||||
|
||||
<uniform>
|
||||
<name>BaseTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>ReflNoiseTex</name>
|
||||
<type>sampler-3d</type>
|
||||
<value type="int">1</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>NormalTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">2</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>LightMapTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">3</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>ReflMapTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">4</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>Environment</name>
|
||||
<type>sampler-cube</type>
|
||||
<value type="int">5</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>ReflFresnelTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">6</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>ReflRainbowTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">7</value>
|
||||
</uniform>
|
||||
|
||||
<!-- NORMAL MAP -->
|
||||
<!-- normalmap is used-->
|
||||
<uniform>
|
||||
<name>nmap_enabled</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>normalmap-enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- normalmap is .dds-->
|
||||
<uniform>
|
||||
<name>nmap_dds</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>normalmap-dds</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>nmap_tile</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>normalmap-tiling</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- LIGHTMAP -->
|
||||
<!-- lightmap is used -->
|
||||
<uniform>
|
||||
<name>lightmap_enabled</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>lightmap-enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- lightmap is multichannel -->
|
||||
<uniform>
|
||||
<name>lightmap_multi</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>lightmap-multi</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_r_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>lightmap-factor[0]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_r_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>lightmap-color[0]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_g_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>lightmap-factor[1]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_g_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>lightmap-color[1]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_b_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>lightmap-factor[2]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_b_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>lightmap-color[2]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_a_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>lightmap-factor[3]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_a_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>lightmap-color[3]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- reflection is used -->
|
||||
<uniform>
|
||||
<name>refl_enabled</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>reflection-enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- reflection correction -->
|
||||
<uniform>
|
||||
<name>refl_correction</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>reflection-correction</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- use a reflection map-->
|
||||
<uniform>
|
||||
<name>refl_map</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>reflect-map-enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- reflection is dynamic -->
|
||||
<uniform>
|
||||
<name>refl_dynamic</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>reflection-dynamic</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of fringing colour 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>refl_rainbow</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>reflection-rainbow</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of fresnel effect colour 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>refl_fresnel</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>reflection-fresnel</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of noisiness 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>refl_noise</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>reflection-noise</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- dirt -->
|
||||
<uniform>
|
||||
<name>dirt_enabled</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>dirt-enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>dirt_multi</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>dirt-multi</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>dirt_r_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>dirt-color[0]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>dirt_r_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>dirt-factor[0]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>dirt_g_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>dirt-color[1]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>dirt_g_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>dirt-factor[1]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>dirt_b_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>dirt-color[2]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>dirt_b_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>dirt-factor[2]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of ambient light correction 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>amb_correction</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>ambient-correction</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- shader quality -->
|
||||
<uniform>
|
||||
<name>shader_qual</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>shader-quality</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>hdg</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>model-hdg</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>pitch</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>model-pitch</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>roll</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>model-roll</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 -->
|
||||
<uniform>
|
||||
<name>rembrandt_enabled</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>rembrandt</use>
|
||||
</value>
|
||||
</uniform>
|
||||
</pass>
|
||||
</technique>
|
||||
</PropertyList>
|
|
@ -151,617 +151,8 @@ please see Docs/README.model-combined.eff for documentation
|
|||
<binormal type="int">7</binormal>
|
||||
</generate>-->
|
||||
|
||||
<!-- Rembrandt rendering -->
|
||||
<technique n="8">
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/model</property>
|
||||
<property>/sim/rendering/rembrandt/enabled</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>
|
||||
<depth>
|
||||
<write-mask type="bool">false</write-mask>
|
||||
</depth>
|
||||
<material>
|
||||
<active>
|
||||
<use>material/active</use>
|
||||
</active>
|
||||
<ambient>
|
||||
<use>material/ambient</use>
|
||||
</ambient>
|
||||
<diffuse>
|
||||
<use>material/diffuse</use>
|
||||
</diffuse>
|
||||
<specular>
|
||||
<use>material/specular</use>
|
||||
</specular>
|
||||
<emissive>
|
||||
<use>material/emissive</use>
|
||||
</emissive>
|
||||
<shininess>
|
||||
<use>material/shininess</use>
|
||||
</shininess>
|
||||
<color-mode>
|
||||
<use>material/color-mode</use>
|
||||
</color-mode>
|
||||
</material>
|
||||
<blend>
|
||||
<active>
|
||||
<use>blend/active</use>
|
||||
</active>
|
||||
<source>
|
||||
<use>blend/source</use>
|
||||
</source>
|
||||
<destination>
|
||||
<use>blend/destination</use>
|
||||
</destination>
|
||||
</blend>
|
||||
<shade-model>
|
||||
<use>shade-model</use>
|
||||
</shade-model>
|
||||
<cull-face>
|
||||
<use>cull-face</use>
|
||||
</cull-face>
|
||||
<rendering-hint>
|
||||
<use>rendering-hint</use>
|
||||
</rendering-hint>
|
||||
<blend>
|
||||
<use>transparent</use>
|
||||
</blend>
|
||||
<alpha-test>
|
||||
<use>transparent</use>
|
||||
</alpha-test>
|
||||
<render-bin>
|
||||
<bin-number>111</bin-number>
|
||||
<bin-name>DepthSortedBin</bin-name>
|
||||
</render-bin>
|
||||
<!-- Diffuse texture unit-->
|
||||
<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>
|
||||
<!-- Reflection Noise texture unit-->
|
||||
<texture-unit>
|
||||
<unit>1</unit>
|
||||
<type>noise</type>
|
||||
</texture-unit>
|
||||
<!-- NormalMap 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>
|
||||
<!-- LightMap 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>
|
||||
<!-- ReflectMap 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>
|
||||
<!-- Reflection CubeMap texture unit-->
|
||||
<texture-unit>
|
||||
<unit>5</unit>
|
||||
<type>
|
||||
<use>texture[5]/type</use>
|
||||
</type>
|
||||
<!-- use this form for a cube cross -->
|
||||
<!--<image><use>texture[5]/image</use></image>-->
|
||||
<!-- END CubeCross -->
|
||||
<!-- use this form for a 6 image cube map -->
|
||||
<images>
|
||||
<use>texture[5]/images</use>
|
||||
</images>
|
||||
<!-- END 6 image cube map -->
|
||||
</texture-unit>
|
||||
<!-- Reflection fresnel texture unit-->
|
||||
<texture-unit>
|
||||
<unit>6</unit>
|
||||
<image>
|
||||
<use>texture[6]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[6]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[6]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[6]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[6]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<!-- Reflection rainbow texture unit-->
|
||||
<texture-unit>
|
||||
<unit>7</unit>
|
||||
<image>
|
||||
<use>texture[7]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[7]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[7]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[7]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[7]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
|
||||
|
||||
<vertex-program-two-side>
|
||||
<use>vertex-program-two-side</use>
|
||||
</vertex-program-two-side>
|
||||
|
||||
<program>
|
||||
<!-- <vertex-shader n="0">Shaders/include_fog.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="1">Shaders/ubershader.frag</fragment-shader>
|
||||
<!--<attribute>
|
||||
<name>tangent</name>
|
||||
<index>6</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>binormal</name>
|
||||
<index>7</index>
|
||||
</attribute>-->
|
||||
</program>
|
||||
|
||||
<uniform>
|
||||
<name>BaseTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>ReflNoiseTex</name>
|
||||
<type>sampler-3d</type>
|
||||
<value type="int">1</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>NormalTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">2</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>LightMapTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">3</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>ReflMapTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">4</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>Environment</name>
|
||||
<type>sampler-cube</type>
|
||||
<value type="int">5</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>ReflFresnelTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">6</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>ReflRainbowTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">7</value>
|
||||
</uniform>
|
||||
|
||||
<!-- NORMAL MAP -->
|
||||
<!-- normalmap is used-->
|
||||
<uniform>
|
||||
<name>nmap_enabled</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>normalmap-enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- normalmap is .dds-->
|
||||
<uniform>
|
||||
<name>nmap_dds</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>normalmap-dds</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>nmap_tile</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>normalmap-tiling</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- LIGHTMAP -->
|
||||
<!-- lightmap is used -->
|
||||
<uniform>
|
||||
<name>lightmap_enabled</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>lightmap-enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- lightmap is multichannel -->
|
||||
<uniform>
|
||||
<name>lightmap_multi</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>lightmap-multi</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_r_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>lightmap-factor[0]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_r_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>lightmap-color[0]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_g_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>lightmap-factor[1]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_g_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>lightmap-color[1]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_b_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>lightmap-factor[2]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_b_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>lightmap-color[2]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_a_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>lightmap-factor[3]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_a_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>lightmap-color[3]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- reflection is used -->
|
||||
<uniform>
|
||||
<name>refl_enabled</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>reflection-enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- reflection correction -->
|
||||
<uniform>
|
||||
<name>refl_correction</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>reflection-correction</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- use a reflection map-->
|
||||
<uniform>
|
||||
<name>refl_map</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>reflect-map-enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- reflection is dynamic -->
|
||||
<uniform>
|
||||
<name>refl_dynamic</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>reflection-dynamic</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of fringing colour 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>refl_rainbow</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>reflection-rainbow</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of fresnel effect colour 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>refl_fresnel</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>reflection-fresnel</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of noisiness 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>refl_noise</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>reflection-noise</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- dirt -->
|
||||
<uniform>
|
||||
<name>dirt_enabled</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>dirt-enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>dirt_multi</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>dirt-multi</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>dirt_r_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>dirt-color[0]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>dirt_r_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>dirt-factor[0]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>dirt_g_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>dirt-color[1]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>dirt_g_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>dirt-factor[1]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>dirt_b_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>dirt-color[2]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>dirt_b_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>dirt-factor[2]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of ambient light correction 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>amb_correction</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>ambient-correction</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- shader quality -->
|
||||
<uniform>
|
||||
<name>shader_qual</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>shader-quality</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>hdg</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>model-hdg</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>pitch</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>model-pitch</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>roll</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>model-roll</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 -->
|
||||
<uniform>
|
||||
<name>rembrandt_enabled</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>rembrandt</use>
|
||||
</value>
|
||||
</uniform>
|
||||
</pass>
|
||||
</technique>
|
||||
|
||||
<!-- Default rendering -->
|
||||
<technique n="9">
|
||||
<predicate>
|
||||
|
@ -1069,7 +460,7 @@ please see Docs/README.model-combined.eff for documentation
|
|||
|
||||
<uniform>
|
||||
<name>nmap_tile</name>
|
||||
<type>int</type>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>normalmap-tiling</use>
|
||||
</value>
|
||||
|
|
|
@ -24,7 +24,6 @@ uniform sampler3D ReflNoiseTex;
|
|||
|
||||
uniform int nmap_enabled;
|
||||
uniform int nmap_dds;
|
||||
uniform int nmap_tile;
|
||||
uniform int refl_enabled;
|
||||
uniform int refl_map;
|
||||
uniform int lightmap_enabled;
|
||||
|
@ -37,6 +36,7 @@ uniform float lightmap_r_factor;
|
|||
uniform float lightmap_g_factor;
|
||||
uniform float lightmap_b_factor;
|
||||
uniform float lightmap_a_factor;
|
||||
uniform float nmap_tile;
|
||||
uniform float refl_correction;
|
||||
uniform float refl_fresnel;
|
||||
uniform float refl_rainbow;
|
||||
|
@ -95,7 +95,7 @@ void main (void)
|
|||
float v = abs(dot(viewVec, normalize(VNormal)));// Map a rainbowish color
|
||||
vec4 fresnel = texture2D(ReflFresnelTex, vec2(v, 0.0));
|
||||
vec4 rainbow = texture2D(ReflRainbowTex, vec2(v, 0.0));
|
||||
vec4 color = gl_Color * gl_FrontMaterial.diffuse;
|
||||
vec4 color = gl_Color;// * gl_FrontMaterial.diffuse;
|
||||
float specular = dot((gl_FrontMaterial.specular * nmap.a).rgb, vec3( 0.3, 0.59, 0.11 ));
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -5,47 +5,47 @@
|
|||
// Emilian Huminiuc and Vivian Meazza 2011
|
||||
#version 120
|
||||
|
||||
varying vec3 rawpos;
|
||||
varying vec3 VBinormal;
|
||||
varying vec3 VNormal;
|
||||
varying vec3 VTangent;
|
||||
varying vec3 VBinormal;
|
||||
varying vec3 vViewVec;
|
||||
varying vec3 rawpos;
|
||||
varying vec3 reflVec;
|
||||
varying vec3 vViewVec;
|
||||
|
||||
varying float alpha;
|
||||
|
||||
uniform samplerCube Environment;
|
||||
uniform sampler2D BaseTex;
|
||||
uniform sampler2D NormalTex;
|
||||
uniform sampler2D LightMapTex;
|
||||
uniform sampler2D ReflMapTex;
|
||||
uniform sampler2D NormalTex;
|
||||
uniform sampler2D ReflFresnelTex;
|
||||
uniform sampler2D ReflMapTex;
|
||||
uniform sampler2D ReflRainbowTex;
|
||||
uniform sampler3D ReflNoiseTex;
|
||||
uniform samplerCube Environment;
|
||||
|
||||
uniform int nmap_enabled;
|
||||
uniform int nmap_dds;
|
||||
uniform int nmap_tile;
|
||||
uniform int refl_enabled;
|
||||
uniform int refl_map;
|
||||
uniform int lightmap_enabled;
|
||||
uniform int lightmap_multi;
|
||||
uniform int shader_qual;
|
||||
uniform int dirt_enabled;
|
||||
uniform int dirt_multi;
|
||||
uniform int lightmap_enabled;
|
||||
uniform int lightmap_multi;
|
||||
uniform int nmap_dds;
|
||||
uniform int nmap_enabled;
|
||||
uniform int refl_enabled;
|
||||
uniform int refl_map;
|
||||
uniform int shader_qual;
|
||||
|
||||
uniform float lightmap_r_factor;
|
||||
uniform float lightmap_g_factor;
|
||||
uniform float lightmap_b_factor;
|
||||
uniform float amb_correction;
|
||||
uniform float dirt_b_factor;
|
||||
uniform float dirt_g_factor;
|
||||
uniform float dirt_r_factor;
|
||||
uniform float lightmap_a_factor;
|
||||
uniform float lightmap_b_factor;
|
||||
uniform float lightmap_g_factor;
|
||||
uniform float lightmap_r_factor;
|
||||
uniform float nmap_tile;
|
||||
uniform float refl_correction;
|
||||
uniform float refl_fresnel;
|
||||
uniform float refl_rainbow;
|
||||
uniform float refl_noise;
|
||||
uniform float amb_correction;
|
||||
uniform float dirt_r_factor;
|
||||
uniform float dirt_g_factor;
|
||||
uniform float dirt_b_factor;
|
||||
uniform float refl_rainbow;
|
||||
|
||||
uniform vec3 lightmap_r_color;
|
||||
uniform vec3 lightmap_g_color;
|
||||
|
@ -104,7 +104,7 @@ void main (void)
|
|||
pf = pow(nDotHV, gl_FrontMaterial.shininess);
|
||||
|
||||
vec4 Diffuse = gl_LightSource[0].diffuse * nDotVP;
|
||||
vec4 Specular = gl_FrontMaterial.specular * gl_LightSource[0].specular * pf;
|
||||
vec4 Specular = gl_FrontMaterial.specular * gl_LightSource[0].diffuse * pf;
|
||||
|
||||
vec4 color = gl_Color + Diffuse * gl_FrontMaterial.diffuse;
|
||||
color += Specular * gl_FrontMaterial.specular * nmap.a;
|
||||
|
@ -136,7 +136,7 @@ void main (void)
|
|||
vec4 noisecolor = mix(reflfrescolor, noisevec, refl_noise);
|
||||
vec4 raincolor = vec4(noisecolor.rgb * reflFactor, 1.0);
|
||||
raincolor += Specular * nmap.a;
|
||||
|
||||
raincolor *= gl_LightSource[0].diffuse;
|
||||
mixedcolor = mix(texel, raincolor, reflFactor).rgb;
|
||||
} else {
|
||||
mixedcolor = texel.rgb;
|
||||
|
|
Loading…
Reference in a new issue