GSdx ogl: ouch the typo exp != exp2

Fix some rounding issue on depth effect (shadow in Dot hack games)
This commit is contained in:
Gregory Hainaut 2016-04-10 11:27:56 +02:00
parent c2a9118186
commit 12443da00c
4 changed files with 8 additions and 8 deletions

View File

@ -178,7 +178,7 @@ void ps_main13()
{
// Convert a RRGBA texture into a float depth texture
// FIXME: I'm afraid of the accuracy
const vec4 bitSh = vec4(exp2(-32.0f), exp2(-24.0f), exp2(-16.0f), exp(-8.0f)) * vec4(255.0);
const vec4 bitSh = vec4(exp2(-32.0f), exp2(-24.0f), exp2(-16.0f), exp2(-8.0f)) * vec4(255.0);
gl_FragDepth = dot(sample_c(), bitSh);
}
#endif
@ -212,7 +212,7 @@ void ps_main16()
{
// Convert a RGB5A1 (saved as RGBA8) color to a 16 bit Z
// FIXME: I'm afraid of the accuracy
const vec4 bitSh = vec4(exp2(-32.0f), exp2(-27.0f), exp2(-22.0f), exp(-17.0f));
const vec4 bitSh = vec4(exp2(-32.0f), exp2(-27.0f), exp2(-22.0f), exp2(-17.0f));
// Trunc color to drop useless lsb
vec4 color = trunc(sample_c() * vec4(255.0f) / vec4(8.0f, 8.0f, 8.0f, 128.0f));
gl_FragDepth = dot(vec4(color), bitSh);

View File

@ -203,7 +203,7 @@ static const char* convert_glsl =
"{\n"
" // Convert a RRGBA texture into a float depth texture\n"
" // FIXME: I'm afraid of the accuracy\n"
" const vec4 bitSh = vec4(exp2(-32.0f), exp2(-24.0f), exp2(-16.0f), exp(-8.0f)) * vec4(255.0);\n"
" const vec4 bitSh = vec4(exp2(-32.0f), exp2(-24.0f), exp2(-16.0f), exp2(-8.0f)) * vec4(255.0);\n"
" gl_FragDepth = dot(sample_c(), bitSh);\n"
"}\n"
"#endif\n"
@ -237,7 +237,7 @@ static const char* convert_glsl =
"{\n"
" // Convert a RGB5A1 (saved as RGBA8) color to a 16 bit Z\n"
" // FIXME: I'm afraid of the accuracy\n"
" const vec4 bitSh = vec4(exp2(-32.0f), exp2(-27.0f), exp2(-22.0f), exp(-17.0f));\n"
" const vec4 bitSh = vec4(exp2(-32.0f), exp2(-27.0f), exp2(-22.0f), exp2(-17.0f));\n"
" // Trunc color to drop useless lsb\n"
" vec4 color = trunc(sample_c() * vec4(255.0f) / vec4(8.0f, 8.0f, 8.0f, 128.0f));\n"
" gl_FragDepth = dot(vec4(color), bitSh);\n"

View File

@ -178,7 +178,7 @@ void ps_main13()
{
// Convert a RRGBA texture into a float depth texture
// FIXME: I'm afraid of the accuracy
const vec4 bitSh = vec4(exp2(-32.0f), exp2(-24.0f), exp2(-16.0f), exp(-8.0f)) * vec4(255.0);
const vec4 bitSh = vec4(exp2(-32.0f), exp2(-24.0f), exp2(-16.0f), exp2(-8.0f)) * vec4(255.0);
gl_FragDepth = dot(sample_c(), bitSh);
}
#endif
@ -212,7 +212,7 @@ void ps_main16()
{
// Convert a RGB5A1 (saved as RGBA8) color to a 16 bit Z
// FIXME: I'm afraid of the accuracy
const vec4 bitSh = vec4(exp2(-32.0f), exp2(-27.0f), exp2(-22.0f), exp(-17.0f));
const vec4 bitSh = vec4(exp2(-32.0f), exp2(-27.0f), exp2(-22.0f), exp2(-17.0f));
// Trunc color to drop useless lsb
vec4 color = trunc(sample_c() * vec4(255.0f) / vec4(8.0f, 8.0f, 8.0f, 128.0f));
gl_FragDepth = dot(vec4(color), bitSh);

View File

@ -203,7 +203,7 @@ static const char* convert_glsl =
"{\n"
" // Convert a RRGBA texture into a float depth texture\n"
" // FIXME: I'm afraid of the accuracy\n"
" const vec4 bitSh = vec4(exp2(-32.0f), exp2(-24.0f), exp2(-16.0f), exp(-8.0f)) * vec4(255.0);\n"
" const vec4 bitSh = vec4(exp2(-32.0f), exp2(-24.0f), exp2(-16.0f), exp2(-8.0f)) * vec4(255.0);\n"
" gl_FragDepth = dot(sample_c(), bitSh);\n"
"}\n"
"#endif\n"
@ -237,7 +237,7 @@ static const char* convert_glsl =
"{\n"
" // Convert a RGB5A1 (saved as RGBA8) color to a 16 bit Z\n"
" // FIXME: I'm afraid of the accuracy\n"
" const vec4 bitSh = vec4(exp2(-32.0f), exp2(-27.0f), exp2(-22.0f), exp(-17.0f));\n"
" const vec4 bitSh = vec4(exp2(-32.0f), exp2(-27.0f), exp2(-22.0f), exp2(-17.0f));\n"
" // Trunc color to drop useless lsb\n"
" vec4 color = trunc(sample_c() * vec4(255.0f) / vec4(8.0f, 8.0f, 8.0f, 128.0f));\n"
" gl_FragDepth = dot(vec4(color), bitSh);\n"