From c937a22f2603cc2a2f10455a6a289c674c0df0da Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 9 May 2013 23:31:53 -0700 Subject: [PATCH] Only double the color with color doubling. Not the alpha. --- GPU/GLES/FragmentShaderGenerator.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/GPU/GLES/FragmentShaderGenerator.cpp b/GPU/GLES/FragmentShaderGenerator.cpp index 36bb962ac3..7686992abc 100644 --- a/GPU/GLES/FragmentShaderGenerator.cpp +++ b/GPU/GLES/FragmentShaderGenerator.cpp @@ -255,10 +255,6 @@ void GenerateFragmentShader(char *buffer) { WRITE(p, " vec4 v = v_color0 %s;\n", secondary); } - if (enableColorDoubling) { - WRITE(p, " v = v * 2.0;\n"); - } - if (enableAlphaTest) { int alphaTestFunc = gstate.alphatest & 7; const char *alphaTestFuncs[] = { "#", "#", " != ", " == ", " >= ", " > ", " <= ", " < " }; // never/always don't make sense @@ -267,7 +263,12 @@ void GenerateFragmentShader(char *buffer) { } } - if (enableAlphaDoubling) { + // TODO: Before or after the color test? + if (enableColorDoubling && enableAlphaDoubling) { + WRITE(p, " v = v * 2.0;\n"); + } else if (enableColorDoubling) { + WRITE(p, " v.rgb = v.rgb * 2.0;\n"); + } else if (enableAlphaDoubling) { WRITE(p, " v.a = v.a * 2.0;\n"); }