From 493109e3ed31ebb8fab0969fe571be0d4cea8b97 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Tue, 8 Mar 2011 22:52:28 +0000 Subject: [PATCH] video: add deactivated shader code for 4x4 Bayer dithering. --- src/video.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/video.cpp b/src/video.cpp index a4a6a893..6bac7506 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -86,7 +86,20 @@ static char const *fragmentshader = //" gl_FragColor = vec4(0.5, 1.0, 0.0, 0.5);\n" //" gl_FragColor = vec4(pass_TexCoord * 4.0, 0.0, 0.25);\n" #else - " gl_FragColor = texture2D(in_Texture, vec2(gl_TexCoord[0]));\n" + " vec4 col = texture2D(in_Texture, vec2(gl_TexCoord[0]));\n" +#if 0 + " float dx1 = mod(gl_FragCoord.x, 2.0);\n" + " float dy1 = mod(gl_FragCoord.y, 2.0);\n" + " float t1 = mod(3.0 * dx1 + 2.0 * dy1, 4.0);\n" + " float dx2 = mod(floor(gl_FragCoord.x * 0.5), 2.0);\n" + " float dy2 = mod(floor(gl_FragCoord.y * 0.5), 2.0);\n" + " float t2 = mod(3.0 * dx2 + 2.0 * dy2, 4.0);\n" + " float t = (1.0 + 4.0 * t1 + t2) / 17.0;\n" + " col.x = col.x > t ? 1.0 : 0.0;\n" + " col.y = col.y > t ? 1.0 : 0.0;\n" + " col.z = col.z > t ? 1.0 : 0.0;\n" +#endif + " gl_FragColor = col;\n" #endif "}\n"; #endif