From 52a9f0f4041932c38ef07c932aef189957f4164c Mon Sep 17 00:00:00 2001 From: divverent Date: Sun, 2 May 2010 12:34:12 +0000 Subject: [PATCH] this supposedly is faster on older cards (or with badly optimizing drivers) From: Wolfgang (Blub) Bumiller git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10121 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_rmain.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gl_rmain.c b/gl_rmain.c index fbb8d33c..cab744cf 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -709,18 +709,18 @@ static const char *builtinshaderstring = " vec3 y4 = texture2D(Texture_First, TexCoord1 + vec2( px.x, px.y)).rgb;\n" " vec3 y5 = texture2D(Texture_First, TexCoord1 + vec2( 0.0, px.y)).rgb;\n" " vec3 y6 = texture2D(Texture_First, TexCoord1 + vec2(-px.x, px.y)).rgb;\n" -" float px1 = -1.0 * (0.30*x1.r + 0.59*x1.g + 0.11*x1.b);\n" -" float px2 = -2.0 * (0.30*x2.r + 0.59*x2.g + 0.11*x2.b);\n" -" float px3 = -1.0 * (0.30*x3.r + 0.59*x3.g + 0.11*x3.b);\n" -" float px4 = 1.0 * (0.30*x4.r + 0.59*x4.g + 0.11*x4.b);\n" -" float px5 = 2.0 * (0.30*x5.r + 0.59*x5.g + 0.11*x5.b);\n" -" float px6 = 1.0 * (0.30*x6.r + 0.59*x6.g + 0.11*x6.b);\n" -" float py1 = -1.0 * (0.30*y1.r + 0.59*y1.g + 0.11*y1.b);\n" -" float py2 = -2.0 * (0.30*y2.r + 0.59*y2.g + 0.11*y2.b);\n" -" float py3 = -1.0 * (0.30*y3.r + 0.59*y3.g + 0.11*y3.b);\n" -" 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" +" float px1 = -1.0 * dot(vec3(0.3, 0.59, 0.11), x1);\n" +" float px2 = -2.0 * dot(vec3(0.3, 0.59, 0.11), x2);\n" +" float px3 = -1.0 * dot(vec3(0.3, 0.59, 0.11), x3);\n" +" float px4 = 1.0 * dot(vec3(0.3, 0.59, 0.11), x4);\n" +" float px5 = 2.0 * dot(vec3(0.3, 0.59, 0.11), x5);\n" +" float px6 = 1.0 * dot(vec3(0.3, 0.59, 0.11), x6);\n" +" float py1 = -1.0 * dot(vec3(0.3, 0.59, 0.11), y1);\n" +" float py2 = -2.0 * dot(vec3(0.3, 0.59, 0.11), y2);\n" +" float py3 = -1.0 * dot(vec3(0.3, 0.59, 0.11), y3);\n" +" float py4 = 1.0 * dot(vec3(0.3, 0.59, 0.11), y4);\n" +" float py5 = 2.0 * dot(vec3(0.3, 0.59, 0.11), y5);\n" +" float py6 = 1.0 * dot(vec3(0.3, 0.59, 0.11), y6);\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" -- 2.39.2