diff --git a/plugins/GSdx/GSRendererOGL.cpp b/plugins/GSdx/GSRendererOGL.cpp index 4e0bd1d842..bbc61d601b 100644 --- a/plugins/GSdx/GSRendererOGL.cpp +++ b/plugins/GSdx/GSRendererOGL.cpp @@ -964,7 +964,7 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour } if (ps_sel.hdr) { - hdr_rt = dev->CreateTexture(rtsize.x, rtsize.y, GL_RGBA16F); + hdr_rt = dev->CreateTexture(rtsize.x, rtsize.y, GL_RGBA32F); dev->CopyRectConv(rt, hdr_rt, ComputeBoundingBox(rtscale, rtsize), false); diff --git a/plugins/GSdx/res/glsl/tfx_fs.glsl b/plugins/GSdx/res/glsl/tfx_fs.glsl index 172254772d..7eae7dae13 100644 --- a/plugins/GSdx/res/glsl/tfx_fs.glsl +++ b/plugins/GSdx/res/glsl/tfx_fs.glsl @@ -600,6 +600,9 @@ void ps_main() #if PS_HDR == 1 // Use negative value to avoid overflow of the texture (in accumulation mode) + // Note: code were initially done for an Half-Float texture. Due to overflow + // the texture was upgraded to a full float. Maybe this code is useless now! + // Good testcase is castlevania if (any(greaterThan(C.rgb, vec3(128.0f)))) { C.rgb = (C.rgb - 256.0f); } diff --git a/plugins/GSdx/res/glsl_source.h b/plugins/GSdx/res/glsl_source.h index c18ff5619a..a499d2ea28 100644 --- a/plugins/GSdx/res/glsl_source.h +++ b/plugins/GSdx/res/glsl_source.h @@ -1475,6 +1475,9 @@ static const char* tfx_fs_all_glsl = "\n" "#if PS_HDR == 1\n" " // Use negative value to avoid overflow of the texture (in accumulation mode)\n" + " // Note: code were initially done for an Half-Float texture. Due to overflow\n" + " // the texture was upgraded to a full float. Maybe this code is useless now!\n" + " // Good testcase is castlevania\n" " if (any(greaterThan(C.rgb, vec3(128.0f)))) {\n" " C.rgb = (C.rgb - 256.0f);\n" " }\n"