float xll_saturate_f( float x) { return clamp( x, 0.0, 1.0); } vec2 xll_saturate_vf2( vec2 x) { return clamp( x, 0.0, 1.0); } vec3 xll_saturate_vf3( vec3 x) { return clamp( x, 0.0, 1.0); } vec4 xll_saturate_vf4( vec4 x) { return clamp( x, 0.0, 1.0); } mat2 xll_saturate_mf2x2(mat2 m) { return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0)); } mat3 xll_saturate_mf3x3(mat3 m) { return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0)); } mat4 xll_saturate_mf4x4(mat4 m) { return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0)); } #line 1 uniform sampler2D tex; float samples[10]; #line 21 #line 21 vec4 xlat_main( in vec4 Pos, in vec2 texCoord, float sampleDist, float sampleStrength ) { vec2 dir = (0.5 - texCoord); #line 28 float dist = sqrt(((dir.x * dir.x) + (dir.y * dir.y))); #line 32 dir = normalize(dir); vec4 color = texture2D( tex, texCoord); #line 37 vec4 sum = color; int i = 0; for ( ; (i < 10); (i++)) { vec4 res = texture2D( tex, (texCoord + ((dir * samples[i]) * sampleDist))); #line 41 sum += res; } sum /= 11.0; #line 47 float t = (dist * sampleStrength); t = xll_saturate_f(t); #line 51 return mix( color, sum, vec4( t)); } uniform float xlu_sampleDist; uniform float xlu_sampleStrength; varying vec2 xlv_TEXCOORD0; void main() { samples[0] = -0.08; samples[1] = -0.05; samples[2] = -0.03; samples[3] = -0.02; samples[4] = -0.01; samples[5] = 0.01; samples[6] = 0.02; samples[7] = 0.03; samples[8] = 0.05; samples[9] = 0.08; vec4 xl_retval; xl_retval = xlat_main( vec4(0.0), vec2(xlv_TEXCOORD0), xlu_sampleDist, xlu_sampleStrength); gl_FragData[0] = vec4(xl_retval); } // uniforms: // sampleDist: type 9 arrsize 0 // sampleStrength: type 9 arrsize 0 // tex: type 25 arrsize 0