1 uniform sampler2D sceneTex;
2 uniform float textureWidth;
3 uniform float textureHeight;
6 // Converts pixel coordinates to texture coordinates
9 return vec2(pix.x / textureWidth, 1.0 - pix.y / textureHeight);
15 vec3 tex = texture2D(sceneTex, pix2tex(gl_TexCoord[0].xy)).rgb * (1.0 + 4.0 * amount);
17 tex -= texture2D(sceneTex, pix2tex(gl_TexCoord[0].xy + vec2(0.0, 1.0))).rgb * amount;
18 tex -= texture2D(sceneTex, pix2tex(gl_TexCoord[0].xy + vec2(0.0, -1.0))).rgb * amount;
19 tex -= texture2D(sceneTex, pix2tex(gl_TexCoord[0].xy + vec2(1.0, 0.0))).rgb * amount;
20 tex -= texture2D(sceneTex, pix2tex(gl_TexCoord[0].xy + vec2(-1.0, 0.0))).rgb * amount;
22 gl_FragColor = vec4(tex, 1.0);