]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - shader_glsl.h
Properly make the blur conditional on non empty uservecs 1 and 2.
[xonotic/darkplaces.git] / shader_glsl.h
index 1c6cb906768149fce8126ff71705baf75a5ec494..cb839f108821691eb84b067f8f7ac3e226762736 100644 (file)
 "#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",
+"#if defined(USERVEC1) || defined(USERVEC2)\n",
 "      float sobel = 1.0;\n",
 "      // vec2 ts = textureSize(Texture_First, 0);\n",
 "      // vec2 px = vec2(1/ts.x, 1/ts.y);\n",
 "      dp_FragColor /= (1.0 + 5.0 * UserVec1.y);\n",
 "      dp_FragColor.rgb = dp_FragColor.rgb * (1.0 + UserVec2.x) + vec3(max(0.0, sobel - UserVec2.z))*UserVec2.y;\n",
 "#endif\n",
+"#endif\n",
 "\n",
 "#ifdef USEBLOOM\n",
 "      dp_FragColor += max(vec4(0,0,0,0), dp_texture2D(Texture_Second, TexCoord2) - BloomColorSubtract);\n",