diff --git a/plugins/GSdx/res/glsl/convert.glsl b/plugins/GSdx/res/glsl/convert.glsl index f3ef9887b6..0ed4b16a18 100644 --- a/plugins/GSdx/res/glsl/convert.glsl +++ b/plugins/GSdx/res/glsl/convert.glsl @@ -77,7 +77,7 @@ layout(std140, binding = 15) uniform cb15 vec4 sample_c() { - return texture(TextureSampler, PSin_t ); + return texture(TextureSampler, PSin_t); } vec4 ps_crt(uint i) @@ -372,11 +372,7 @@ void ps_main3() #ifdef ps_main4 void ps_main4() { - // FIXME mod and fmod are different when value are negative - // output.c = fmod(sample_c(input.t) * 255 + 0.5f, 256) / 255; - vec4 c = mod(sample_c() * 255.0f + 0.5f, 256.0f) / 255.0f; - - SV_Target0 = c; + SV_Target0 = mod(round(sample_c() * 255.0f), 256.0f) / 255.0f; } #endif diff --git a/plugins/GSdx/res/glsl_source.h b/plugins/GSdx/res/glsl_source.h index dbe510afdf..d56238466c 100644 --- a/plugins/GSdx/res/glsl_source.h +++ b/plugins/GSdx/res/glsl_source.h @@ -102,7 +102,7 @@ static const char* convert_glsl = "\n" "vec4 sample_c()\n" "{\n" - " return texture(TextureSampler, PSin_t );\n" + " return texture(TextureSampler, PSin_t);\n" "}\n" "\n" "vec4 ps_crt(uint i)\n" @@ -397,11 +397,7 @@ static const char* convert_glsl = "#ifdef ps_main4\n" "void ps_main4()\n" "{\n" - " // FIXME mod and fmod are different when value are negative\n" - " // output.c = fmod(sample_c(input.t) * 255 + 0.5f, 256) / 255;\n" - " vec4 c = mod(sample_c() * 255.0f + 0.5f, 256.0f) / 255.0f;\n" - "\n" - " SV_Target0 = c;\n" + " SV_Target0 = mod(round(sample_c() * 255.0f), 256.0f) / 255.0f;\n" "}\n" "#endif\n" "\n"