From 30130f2bd5d354756bd9d8e4d73b1d22c43e1cdd Mon Sep 17 00:00:00 2001 From: Nik Henson Date: Mon, 13 Feb 2012 23:51:32 +0000 Subject: [PATCH] Updated fragment shaders' floating point comparisons and also some knock-on changes from SVN revision 246. --- Src/Graphics/Shaders/Fragment_Flat.glsl | 2 +- Src/Graphics/Shaders/Fragment_NoSpotlight.glsl | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Src/Graphics/Shaders/Fragment_Flat.glsl b/Src/Graphics/Shaders/Fragment_Flat.glsl index 3ddc5f4..bc6c061 100644 --- a/Src/Graphics/Shaders/Fragment_Flat.glsl +++ b/Src/Graphics/Shaders/Fragment_Flat.glsl @@ -111,7 +111,7 @@ void main(void) float insideSpot; // Get polygon color for untextured polygons (textured polygons will overwrite) - if (fsTexParams.x==0.0) + if (fsTexParams.x < 0.5) fragColor = gl_Color; else // Textured polygons: set fragment color to texel value diff --git a/Src/Graphics/Shaders/Fragment_NoSpotlight.glsl b/Src/Graphics/Shaders/Fragment_NoSpotlight.glsl index 05e643a..1a2917c 100644 --- a/Src/Graphics/Shaders/Fragment_NoSpotlight.glsl +++ b/Src/Graphics/Shaders/Fragment_NoSpotlight.glsl @@ -111,7 +111,7 @@ void main(void) float insideSpot; // Get polygon color for untextured polygons (textured polygons will overwrite) - if (fsTexParams.x==0.0) + if (fsTexParams.x < 0.5) fragColor = gl_Color; else // Textured polygons: set fragment color to texel value @@ -167,14 +167,14 @@ void main(void) * When the alpha value is 0.0 (or close), pixels are discarded * entirely. */ - if (fsTexParams.y > 0.0) // contour processing enabled + if (fsTexParams.y > 0.5) // contour processing enabled { if (fragColor.a < 0.01) // discard anything with alpha == 0 discard; } // If contour texture and not discarded, force alpha to 1.0 because will later be modified by polygon translucency - if (fsTexFormat > 0.0) // contour (T1RGB5) texture map + if (fsTexFormat < 0.5) // contour (T1RGB5) texture map fragColor.a = 1.0; }