All pastes #461455 Raw Edit

glsl blur

public c v1 · immutable
#461455 ·published 2007-04-27 18:06 UTC
rendered paste body
uniform sampler2D colorMap;#define textureWidth 600.0#define textureHeight 800.0	#define texel_size_x 1.0 / textureWidth#define texel_size_y 1.0 / textureHeightvec4 texBlur( sampler2D tex, vec2 uv ){	vec2 f;	f.x	= fract( uv.x * textureWidth );	f.y	= fract( uv.y * textureHeight );	vec4 t00 = texture2D( tex, uv + vec2( 0.0, 0.0 ));	vec4 t10 = texture2D( tex, uv + vec2( texel_size_x, 0.0 ));	vec4 tA = mix( t00, t10, f.x);	vec4 t01 = texture2D( tex, uv + vec2( 0.0, texel_size_y ) );	vec4 t11 = texture2D( tex, uv + vec2( texel_size_x, texel_size_y ) );	vec4 tB = mix( t01, t11, f.x );	return mix( tA, tB, f.y );}			void main (void){	gl_FragColor = texBlur( colorMap, gl_TexCoord[0].xy);}