From 8f484567fc25c92c06d7796984e5ab8243eaa0d9 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Thu, 3 Aug 2017 13:36:26 +0200 Subject: vo_opengl: fix HLG OOTF inverse Got the "sign" of the second multiplication wrong. --- video/out/opengl/video_shaders.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/video/out/opengl/video_shaders.c b/video/out/opengl/video_shaders.c index a8170c10d1..fd40dd04ab 100644 --- a/video/out/opengl/video_shaders.c +++ b/video/out/opengl/video_shaders.c @@ -550,7 +550,7 @@ void pass_inverse_ootf(struct gl_shader_cache *sc, enum mp_csp_light light, floa { case MP_CSP_LIGHT_SCENE_HLG: GLSLF("color.rgb *= vec3(1.0/%f);\n", (1000 / MP_REF_WHITE) / pow(12, 1.2)); - GLSL(color.rgb *= vec3(pow(dot(src_luma, color.rgb), 0.2/1.2));) + GLSL(color.rgb /= vec3(max(1e-6, pow(dot(src_luma, color.rgb), 0.2/1.2)));) break; case MP_CSP_LIGHT_SCENE_709_1886: GLSL(color.rgb = pow(color.rgb, vec3(1.0/2.4));) -- cgit v1.2.3