]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rmain.c
add a second parameter to the blur to mix the pentagram blur with the main image
[xonotic/darkplaces.git] / gl_rmain.c
index e41026c6446a1464fd546c8df71de00daca047db..b48508a32116d47f3ff680ee41449e01478ca05e 100644 (file)
@@ -496,13 +496,13 @@ static const char *builtinshaderstring =
 "\n"
 "#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\n"
-"      gl_FragColor += texture2D(Texture_First, gl_TexCoord[0].xy + PixelSize*UserVec1.x*vec2( 0.987688,  0.156434));\n"
-"      gl_FragColor += texture2D(Texture_First, gl_TexCoord[0].xy + PixelSize*UserVec1.x*vec2( 0.156434,  0.891007));\n"
-"      gl_FragColor += texture2D(Texture_First, gl_TexCoord[0].xy + PixelSize*UserVec1.x*vec2(-0.891007,  0.453990));\n"
-"      gl_FragColor += texture2D(Texture_First, gl_TexCoord[0].xy + PixelSize*UserVec1.x*vec2(-0.707107, -0.707107));\n"
-"      gl_FragColor += texture2D(Texture_First, gl_TexCoord[0].xy + PixelSize*UserVec1.x*vec2( 0.453990, -0.891007));\n"
-"      gl_FragColor /= 6;\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"
+"      gl_FragColor += texture2D(Texture_First, gl_TexCoord[0].xy + PixelSize*UserVec1.x*vec2( 0.987688,  0.156434)) * UserVec1.y;\n"
+"      gl_FragColor += texture2D(Texture_First, gl_TexCoord[0].xy + PixelSize*UserVec1.x*vec2( 0.156434,  0.891007)) * UserVec1.y;\n"
+"      gl_FragColor += texture2D(Texture_First, gl_TexCoord[0].xy + PixelSize*UserVec1.x*vec2(-0.891007,  0.453990)) * UserVec1.y;\n"
+"      gl_FragColor += texture2D(Texture_First, gl_TexCoord[0].xy + PixelSize*UserVec1.x*vec2(-0.707107, -0.707107)) * UserVec1.y;\n"
+"      gl_FragColor += texture2D(Texture_First, gl_TexCoord[0].xy + PixelSize*UserVec1.x*vec2( 0.453990, -0.891007)) * UserVec1.y;\n"
+"      gl_FragColor /= (1 + 5 * UserVec1.y);\n"
 "#endif\n"
 "\n"
 "#ifdef USEGAMMARAMPS\n"