diff --git a/src/GLES2/GLSLCombiner_gles2.cpp b/src/GLES2/GLSLCombiner_gles2.cpp index dcc35fb7..150c027d 100644 --- a/src/GLES2/GLSLCombiner_gles2.cpp +++ b/src/GLES2/GLSLCombiner_gles2.cpp @@ -179,13 +179,6 @@ ShaderCombiner::ShaderCombiner(Combiner & _color, Combiner & _alpha, const gDPCo strFragmentShader.append(" vec_color = vec4(input_color, vShadeColor.a); \n"); strFragmentShader.append(strCombiner); - strFragmentShader.append( - " if (uEnableAlphaTest != 0) { \n" - " lowp float alphaTestValue = (uAlphaCompareMode == 3 && alpha2 > 0.0) ? snoise() : uAlphaTestValue; \n" - " if (alpha2 < alphaTestValue) discard; \n" - " } \n" - ); - if (!g_weakGLSL) { strFragmentShader.append( " lowp int fogUsage = uFogUsage; \n" diff --git a/src/OGL3X/GLSLCombiner_ogl3x.cpp b/src/OGL3X/GLSLCombiner_ogl3x.cpp index 749f72c8..ef7b40c1 100644 --- a/src/OGL3X/GLSLCombiner_ogl3x.cpp +++ b/src/OGL3X/GLSLCombiner_ogl3x.cpp @@ -330,13 +330,6 @@ ShaderCombiner::ShaderCombiner(Combiner & _color, Combiner & _alpha, const gDPCo strFragmentShader.append(" vec_color = vec4(input_color, vShadeColor.a); \n"); strFragmentShader.append(strCombiner); - strFragmentShader.append( - " if (uEnableAlphaTest != 0) { \n" - " lowp float alphaTestValue = (uAlphaCompareMode == 3 && alpha2 > 0.0) ? snoise() : uAlphaTestValue; \n" - " if (alpha2 < alphaTestValue) discard; \n" - " } \n" - ); - if (config.generalEmulation.enableNoise != 0) { strFragmentShader.append( " if (uColorDitherMode == 2) colorNoiseDither(snoise(), color2); \n" diff --git a/src/ShaderUtils.cpp b/src/ShaderUtils.cpp index 5dd73f70..291030c1 100644 --- a/src/ShaderUtils.cpp +++ b/src/ShaderUtils.cpp @@ -235,6 +235,12 @@ int compileCombiner(Combiner & _color, Combiner & _alpha, char * _strShader) } strcpy(_strShader, " alpha1 = "); int nInputs = _compileCombiner(_alpha.stage[0], AlphaInput, _strShader); + strcat(_strShader, + " if (uEnableAlphaTest != 0) { \n" + " lowp float alphaTestValue = (uAlphaCompareMode == 3 && alpha1 > 0.0) ? snoise() : uAlphaTestValue; \n" + " if (alpha1 < alphaTestValue) discard; \n" + " } \n" + ); strcat(_strShader, " color1 = "); nInputs |= _compileCombiner(_color.stage[0], ColorInput, _strShader); strcat(_strShader, fragment_shader_blender);