From 05e3eb80f4797ce5b8a1a6a0106a9907f51e4242 Mon Sep 17 00:00:00 2001 From: Emilian Huminiuc Date: Wed, 18 Jul 2012 20:45:45 +0300 Subject: [PATCH] Make the other sunlight shaders recognize water matId. Remove duplicate fogFunc line in runway.frag Signed-off-by: Emilian Huminiuc --- Shaders/runway.frag | 2 -- Shaders/sunlight-nofiltering.frag | 3 ++- Shaders/sunlight-noshadow.frag | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Shaders/runway.frag b/Shaders/runway.frag index fad9defd9..ca7b5ab00 100644 --- a/Shaders/runway.frag +++ b/Shaders/runway.frag @@ -38,8 +38,6 @@ uniform int fogType; vec3 fog_Func(vec3 color, int type); ////////////////////// -vec3 fog_Func(vec3 color, int type); - void main (void) { //vec3 halfV; diff --git a/Shaders/sunlight-nofiltering.frag b/Shaders/sunlight-nofiltering.frag index 38260c786..af9d0699e 100644 --- a/Shaders/sunlight-nofiltering.frag +++ b/Shaders/sunlight-nofiltering.frag @@ -6,6 +6,7 @@ uniform sampler2D spec_emis_tex; uniform sampler2DShadow shadow_tex; uniform vec4 fg_SunDiffuseColor; uniform vec4 fg_SunSpecularColor; +uniform vec4 fg_SunAmbientColor; uniform vec3 fg_SunDirection; uniform vec3 fg_Planes; uniform int fg_ShadowNumber; @@ -81,7 +82,7 @@ void main() { } float matID = texture2D( color_tex, coords ).a * 255.0; - if (matID == 255.0) + if (matID >= 254.0) Idiff += Ispec * spec_emis.x; gl_FragColor = vec4(mix(vec3(0.0), Idiff + Ispec, shadow) + Iemis, 1.0); diff --git a/Shaders/sunlight-noshadow.frag b/Shaders/sunlight-noshadow.frag index 8b670f5a4..2045b0f1c 100644 --- a/Shaders/sunlight-noshadow.frag +++ b/Shaders/sunlight-noshadow.frag @@ -35,7 +35,7 @@ void main() { } float matID = texture2D( color_tex, coords ).a * 255.0; - if (matID == 255.0) + if (matID >= 254.0) Idiff += Ispec * spec_emis.x; gl_FragColor = vec4(Idiff + Ispec + Iemis, 1.0);