Garry's Mod Wiki

Revision Difference

Shaders/g_blurx#520146

<cat>shader</cat> <title>g_blurx</title>⤶ <shader> <description>Blurs $basetexture in the x direction.</description> <parameters> <item name="basetexture" type="ITexture">The texture to blur.</item> <item name="size" type="number">The strength of the blur. Actually the number of pixels between samples from $basetexture.</item> </parameters> </shader> The response for a single white pixel (255) with $size 1 is { 0, 1, 2, 7, 16, 31, 45, 76, 45, 31, 16, 7, 2, 1, 0 }. <br/> The response for $size 2, is the same response but with 0s are inserted in between each sample.<br/> This is not a gaussian blur. Note that the terms of the response sum to 280, not 255 (1.098 gain). Repeated application of this shader will result in a very bright screen unless some compensation is done (eg. Multiply by 255/280 using UnlitGeneric, $color Vector(255/280, 255/280, 255/280)).