From 74e43de0408bd2eb90725f09ecff26d81186c820 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sun, 22 Jun 2014 18:10:20 +0200 Subject: [PATCH] GLES2RICE: Fix for shader not compiling --- source/gles2rice/src/OGLES2FragmentShaders.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/gles2rice/src/OGLES2FragmentShaders.cpp b/source/gles2rice/src/OGLES2FragmentShaders.cpp index d43fcae..b020d6d 100755 --- a/source/gles2rice/src/OGLES2FragmentShaders.cpp +++ b/source/gles2rice/src/OGLES2FragmentShaders.cpp @@ -37,6 +37,8 @@ const char *vertexShader = "attribute lowp vec2 aAtlasTransform; \n"\ "attribute mediump float aFogCoord; \n"\ " \n"\ +"uniform vec2 FogMinMax; \n"\ +" \n"\ "varying lowp float vFactor; \n"\ "varying lowp vec4 vShadeColor; \n"\ "varying mediump vec2 vTexCoord0; \n"\ @@ -49,8 +51,9 @@ const char *vertexShader = "vShadeColor = aColor; \n"\ "vTexCoord0 = aTexCoord0; \n"\ "vTexCoord1 = aTexCoord1; \n"\ -"vFog = clamp((FogMinMax[1] - aFogCoord)/(FogMinMax[1]-FogMinMax[0]),0.0,1.0); \n"\ +"vFog = (FogMinMax[1] - aFogCoord) / (FogMinMax[1] - FogMinMax[0]); \n"\ " \n"\ +"vFog = clamp(vFog, 0.0, 1.0); \n"\ "} \n"\ " \n"; -- 2.39.5