]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Properly make the blur conditional on non empty uservecs 1 and 2.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 5 Apr 2014 10:07:15 +0000 (10:07 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 5 Apr 2014 10:07:15 +0000 (10:07 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12059 d7cf8633-e32d-0410-b094-e92efae38249

shader_glsl.h
shader_hlsl.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",
index e81e603990d4912e3bb1d7545f4c875eb5fcce64..4a63f1c4f07e7861cd47c9f88b89b77f78189353 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",
 "      // float2 ts = textureSize(Texture_First, 0);\n",
 "      // float2 px = float2(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) + float3(1,1,1)*max(0.0, sobel - UserVec2.z)*UserVec2.y;\n",
 "#endif\n",
+"#endif\n",
 "\n",
 "#ifdef USEBLOOM\n",
 "      dp_FragColor += max(float4(0,0,0,0), tex2D(Texture_Second, TexCoord2) - BloomColorSubtract);\n",