From a445df062ec2a02cb16c172d9ff28b7f3d15aac9 Mon Sep 17 00:00:00 2001 From: divverent Date: Sun, 2 May 2010 12:34:05 +0000 Subject: [PATCH] using float for sobel value From: Wolfgang (Blub) Bumiller git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10119 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=0844b647731820ea65b27974e615f9cc3c6bed1a --- gl_rmain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gl_rmain.c b/gl_rmain.c index d1bcc8da..46e4eac1 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -696,7 +696,7 @@ static const char *builtinshaderstring = "#ifdef USEPOSTPROCESSING\n" "// do r_glsl_dumpshader, edit glsl/default.glsl, and replace this by your own postprocessing if you want\n" "// this code does a blur with the radius specified in the first component of r_glsl_postprocess_uservec1 and blends it using the second component\n" -" vec3 sobel = vec3(1.0);\n" +" float sobel = 1.0;\n" " // vec2 ts = textureSize(Texture_First, 0);\n" " // vec2 px = vec2(1/ts.x, 1/ts.y);\n" " vec2 px = PixelSize;\n" @@ -724,7 +724,7 @@ static const char *builtinshaderstring = " float py4 = 1.0 * (0.30*y4.r + 0.59*y4.g + 0.11*y4.b);\n" " float py5 = 2.0 * (0.30*y5.r + 0.59*y5.g + 0.11*y5.b);\n" " float py6 = 1.0 * (0.30*y6.r + 0.59*y6.g + 0.11*y6.b);\n" -" sobel = vec3(0.25 * abs(px1 + px2 + px3 + px4 + px5 + px6) + 0.25 * abs(py1 + py2 + py3 + py4 + py5 + py6));\n" +" sobel = 0.25 * abs(px1 + px2 + px3 + px4 + px5 + px6) + 0.25 * abs(py1 + py2 + py3 + py4 + py5 + py6);\n" " gl_FragColor += texture2D(Texture_First, TexCoord1 + PixelSize*UserVec1.x*vec2(-0.987688, -0.156434)) * UserVec1.y;\n" " gl_FragColor += texture2D(Texture_First, TexCoord1 + PixelSize*UserVec1.x*vec2(-0.156434, -0.891007)) * UserVec1.y;\n" " gl_FragColor += texture2D(Texture_First, TexCoord1 + PixelSize*UserVec1.x*vec2( 0.891007, -0.453990)) * UserVec1.y;\n" -- 2.39.2