glsl: Round 0.95+ to 1 for texel colors

It improves SotC blooming. Suikoden seems to be fine too.
This commit is contained in:
Gregory Hainaut 2015-07-19 21:06:08 +02:00
parent 01a1b1a5e6
commit 95c374bbcc
2 changed files with 8 additions and 2 deletions

View File

@ -285,7 +285,10 @@ vec4 sample_color(vec2 st, float q)
t = c[0];
#endif
return trunc(t * 255.0f);
// The 0.05f helps to fix the overbloom of sotc
// I think the issue is related to the rounding of texture coodinate. The linear (from fixed unit)
// interpolation could be slightly below the correct one.
return trunc(t * 255.0f + 0.05f);
}
vec4 tfx(vec4 T, vec4 C)

View File

@ -1148,7 +1148,10 @@ static const char* tfx_fs_all_glsl =
" t = c[0];\n"
"#endif\n"
"\n"
" return trunc(t * 255.0f);\n"
" // The 0.05f helps to fix the overbloom of sotc\n"
" // I think the issue is related to the rounding of texture coodinate. The linear (from fixed unit)\n"
" // interpolation could be slightly below the correct one.\n"
" return trunc(t * 255.0f + 0.05f);\n"
"}\n"
"\n"
"vec4 tfx(vec4 T, vec4 C)\n"