#ifdef GL_ES precision mediump int; precision mediump float; #endif #define USE_OGRE_FROM_FUTURE #include SAMPLER2D(RT, 0); SAMPLER2D(BlurX, 1); OGRE_UNIFORMS( uniform vec4 invTexSize; uniform float blurRadius; ) MAIN_PARAMETERS IN(vec2 oUv0, TEXCOORD0) MAIN_DECLARATION { vec4 sum = vec4_splat(0.0); float blurSize = blurRadius * invTexSize.x; //Y-blur. sum += texture2D(BlurX, vec2(oUv0.x, oUv0.y - 4.0 * blurSize)) * vec4_splat(0.04); sum += texture2D(BlurX, vec2(oUv0.x, oUv0.y - 3.0 * blurSize)) * vec4_splat(0.16); sum += texture2D(BlurX, vec2(oUv0.x, oUv0.y - 2.0 * blurSize)) * vec4_splat(0.12); sum += texture2D(BlurX, vec2(oUv0.x, oUv0.y - blurSize)) * vec4_splat(0.16); sum += texture2D(BlurX, oUv0) * vec4_splat(0.2); sum += texture2D(BlurX, vec2(oUv0.x, oUv0.y + blurSize)) * vec4_splat(0.16); sum += texture2D(BlurX, vec2(oUv0.x, oUv0.y + 2.0 * blurSize)) * vec4_splat(0.12); sum += texture2D(BlurX, vec2(oUv0.x, oUv0.y + 3.0 * blurSize)) * vec4_splat(0.08); sum += texture2D(BlurX, vec2(oUv0.x, oUv0.y + 4.0 * blurSize)) * vec4_splat(0.04); gl_FragColor = texture2D(RT, oUv0) + sum * vec4_splat(4.0); }