diff --git a/Effects/bowwave.eff b/Effects/bowwave.eff index ecd7db865..7af277295 100644 --- a/Effects/bowwave.eff +++ b/Effects/bowwave.eff @@ -88,10 +88,14 @@ <heading-deg> <use>/environment/Vinson/hdg-deg</use> </heading-deg> - - <rendering-hint>transparent</rendering-hint> <shade-model>smooth</shade-model> - + <rendering-hint>transparent</rendering-hint> + <transparent>true</transparent> + <render-bin> + <bin-number type="int">6</bin-number> + <bin-name>DepthSortedBin</bin-name> + </render-bin> + <!-- fog include --> <visibility> <use>/environment/ground-visibility-m</use> @@ -527,14 +531,14 @@ </alpha-test> <shade-model>smooth</shade-model> <cull-face>back</cull-face> - <!--<render-bin> + <render-bin> <bin-number> <use>render-bin/bin-number</use> </bin-number> <bin-name> <use>render-bin/bin-name</use> </bin-name> - </render-bin>--> + </render-bin> <texture-unit> <unit>0</unit> <type>noise</type> diff --git a/Effects/model-combined.eff b/Effects/model-combined.eff index 1c0f609d4..cc4b069ab 100644 --- a/Effects/model-combined.eff +++ b/Effects/model-combined.eff @@ -91,8 +91,13 @@ please see Docs/README.model-combined.eff for documentation <!-- END Reflection --> <!-- Dirt --> <dirt-enabled type="int">0</dirt-enabled> - <dirt-color type="vec3d">0.0 0.0 0.0</dirt-color> - <dirt-factor type="float">0.0</dirt-factor> + <dirt-multi type="int">0</dirt-multi> + <dirt-color type="vec3d" n="0">0.0 0.0 0.0</dirt-color> + <dirt-factor type="float" n="0">0.0</dirt-factor> + <dirt-color type="vec3d" n="1">0.0 0.0 0.0</dirt-color> + <dirt-factor type="float" n="1">0.0</dirt-factor> + <dirt-color type="vec3d" n="2">0.0 0.0 0.0</dirt-color> + <dirt-factor type="float" n="2">0.0</dirt-factor> <!-- ambient correction --> <ambient-correction type="float">0.05</ambient-correction> <!-- quality slider --> @@ -602,20 +607,61 @@ please see Docs/README.model-combined.eff for documentation </uniform> <uniform> - <name>dirt_color</name> - <type>float-vec3</type> + <name>dirt_multi</name> + <type>int</type> <value> - <use>dirt-color</use> + <use>dirt-multi</use> </value> </uniform> <uniform> - <name>dirt_factor</name> - <type>float</type> + <name>dirt_r_color</name> + <type>float-vec3</type> <value> - <use>dirt-factor</use> + <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> diff --git a/Shaders/ubershader.frag b/Shaders/ubershader.frag index fb966290b..31d3b989b 100644 --- a/Shaders/ubershader.frag +++ b/Shaders/ubershader.frag @@ -32,6 +32,7 @@ uniform int lightmap_enabled; uniform int lightmap_multi; uniform int shader_qual; uniform int dirt_enabled; +uniform int dirt_multi; uniform float lightmap_r_factor; uniform float lightmap_g_factor; @@ -42,14 +43,18 @@ uniform float refl_fresnel; uniform float refl_rainbow; uniform float refl_noise; uniform float amb_correction; -uniform float dirt_factor; +uniform float dirt_r_factor; +uniform float dirt_g_factor; +uniform float dirt_b_factor; uniform vec3 lightmap_r_color; uniform vec3 lightmap_g_color; uniform vec3 lightmap_b_color; uniform vec3 lightmap_a_color; -uniform vec3 dirt_color; +uniform vec3 dirt_r_color; +uniform vec3 dirt_g_color; +uniform vec3 dirt_b_color; ///fog include////////////////////// uniform int fogType; @@ -151,10 +156,17 @@ void main (void) //begin DIRT ////////////////////////////////////////////////////////////////////// if (dirt_enabled > 0.0){ - vec3 dirtColor = dirt_color * noisevec.rgb; - float dirtFactor = reflmap.r * dirt_factor; - dirtFactor = smoothstep(0.0, 1.0, dirtFactor); - fragColor.rgb = mix(fragColor.rgb, dirtColor, dirtFactor); + float dirtFactorR = reflmap.r * dirt_r_factor; + dirtFactorR = smoothstep(0.0, 1.0, dirtFactorR); + fragColor.rgb = mix(fragColor.rgb, dirt_r_color, dirtFactorR); + if (dirt_multi > 0) { + float dirtFactorG = reflmap.g * dirt_g_factor; + float dirtFactorB = reflmap.b * dirt_b_factor; + dirtFactorG = smoothstep(0.0, 1.0, dirtFactorG); + dirtFactorB = smoothstep(0.0, 1.0, dirtFactorB); + fragColor.rgb = mix(fragColor.rgb, dirt_g_color, dirtFactorG); + fragColor.rgb = mix(fragColor.rgb, dirt_b_color, dirtFactorB); + } } ////////////////////////////////////////////////////////////////////// //END Dirt