mirror of https://github.com/PCSX2/pcsx2.git
glsl: use rounding in convert 4 shader
It will avoid texture rouding error with negative number
This commit is contained in:
parent
7b9fa8fbe5
commit
d191ae4aba
|
@ -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
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue