summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-05-31 21:28:13 +0200
committerwm4 <wm4@nowhere>2013-06-03 00:00:14 +0200
commit87c549ffaecb675991c9aed5358466a62e151a83 (patch)
tree75e229b4eeed286dc5f761cf588785ca00a9d110 /video
parent07fc9395445b9fcb37e90de1c8ca2d5c93aaca3b (diff)
downloadmpv-87c549ffaecb675991c9aed5358466a62e151a83.tar.bz2
mpv-87c549ffaecb675991c9aed5358466a62e151a83.tar.xz
gl_video: explicitly clamp colormatrix output
This could lead to quite visible artifacts when using an appropriate ICC and float FBOs. The float FBOs allow storing out of range values, and my guess is that the rest of the precessing chain elevated these out of range values, resulting in artifacts.
Diffstat (limited to 'video')
-rw-r--r--video/out/gl_video_shaders.glsl1
1 files changed, 1 insertions, 0 deletions
diff --git a/video/out/gl_video_shaders.glsl b/video/out/gl_video_shaders.glsl
index 53524e6cbb..47be240571 100644
--- a/video/out/gl_video_shaders.glsl
+++ b/video/out/gl_video_shaders.glsl
@@ -358,6 +358,7 @@ void main() {
#endif
#ifdef USE_COLORMATRIX
color = mat3(colormatrix) * color + colormatrix[3];
+ color = clamp(color, 0, 1);
#endif
#ifdef USE_CONV_GAMMA
color = pow(color, vec3(conv_gamma));