]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rmain.c
Faster speeds and tighter limits by default
[xonotic/darkplaces.git] / gl_rmain.c
index fbb8d33c750395982b515b312afb3ad8a0386db4..d43a35f9e175304dee000c197de567159d2e989f 100644 (file)
@@ -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"
@@ -728,7 +728,7 @@ static const char *builtinshaderstring =
 "      gl_FragColor += texture2D(Texture_First, TexCoord1 + PixelSize*UserVec1.x*vec2( 0.707107,  0.707107)) * UserVec1.y;\n"
 "      gl_FragColor += texture2D(Texture_First, TexCoord1 + PixelSize*UserVec1.x*vec2(-0.453990,  0.891007)) * UserVec1.y;\n"
 "      gl_FragColor /= (1.0 + 5.0 * UserVec1.y);\n"
-"      gl_FragColor.rgb = gl_FragColor.rgb * UserVec2.x + vec3(max(0.0, sobel - UserVec2.z))*UserVec2.y;\n"
+"      gl_FragColor.rgb = gl_FragColor.rgb * (1.0 + UserVec2.x) + vec3(max(0.0, sobel - UserVec2.z))*UserVec2.y;\n"
 "#endif\n"
 "\n"
 "#ifdef USESATURATION\n"