From 71e517108d19917780107b380cbc3fe83a3dfa65 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Thu, 30 Apr 2015 23:08:05 +0200 Subject: [PATCH] gsdx-ogl: fix colclip Sotc shadow and likely various games :) Thanks to pseudo --- plugins/GSdx/res/glsl/tfx_fs.glsl | 5 +++-- plugins/GSdx/res/glsl_source.h | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/GSdx/res/glsl/tfx_fs.glsl b/plugins/GSdx/res/glsl/tfx_fs.glsl index 51eb214a69..4ddaf100d3 100644 --- a/plugins/GSdx/res/glsl/tfx_fs.glsl +++ b/plugins/GSdx/res/glsl/tfx_fs.glsl @@ -363,10 +363,11 @@ void colclip(inout vec4 c) { #if (PS_COLCLIP == 2) c.rgb = 256.0f/255.0f - c.rgb; -#elif (PS_COLCLIP > 0) +#endif +#if (PS_COLCLIP > 0) // FIXME !!!! //c.rgb *= c.rgb < 128./255; - bvec3 factor = bvec3(128.0f/255.0f, 128.0f/255.0f, 128.0f/255.0f); + bvec3 factor = lessThan(c.rgb, vec3(128.0f/255.0f)); c.rgb *= vec3(factor); #endif } diff --git a/plugins/GSdx/res/glsl_source.h b/plugins/GSdx/res/glsl_source.h index c317f2385a..268d773937 100644 --- a/plugins/GSdx/res/glsl_source.h +++ b/plugins/GSdx/res/glsl_source.h @@ -1104,10 +1104,11 @@ static const char* tfx_fs_all_glsl = "{\n" "#if (PS_COLCLIP == 2)\n" " c.rgb = 256.0f/255.0f - c.rgb;\n" - "#elif (PS_COLCLIP > 0)\n" + "#endif\n" + "#if (PS_COLCLIP > 0)\n" " // FIXME !!!!\n" " //c.rgb *= c.rgb < 128./255;\n" - " bvec3 factor = bvec3(128.0f/255.0f, 128.0f/255.0f, 128.0f/255.0f);\n" + " bvec3 factor = lessThan(c.rgb, vec3(128.0f/255.0f));\n" " c.rgb *= vec3(factor);\n" "#endif\n" "}\n"