#ifdef GL_ES precision mediump int; precision mediump float; #endif #define USE_OGRE_FROM_FUTURE #include SAMPLER2D(RT, 0); OGRE_UNIFORMS( uniform vec2 vTexelSize; ) MAIN_PARAMETERS IN(vec2 oUv0, TEXCOORD0) MAIN_DECLARATION { vec2 usedTexelED[8]; usedTexelED[0] = vec2(-1.0, -1.0); usedTexelED[1] = vec2(0.0, -1.0); usedTexelED[2] = vec2(1.0, -1.0); usedTexelED[3] = vec2(-1.0, 0.0); usedTexelED[4] = vec2(1.0, 0.0); usedTexelED[5] = vec2(-1.0, 1.0); usedTexelED[6] = vec2(0.0, 1.0); usedTexelED[7] = vec2(1.0, 1.0); vec4 tc = texture2D(RT, oUv0); vec4 cAvgColor = vec4_splat(9.0) * tc; for(int t=0; t<8; t++) cAvgColor -= texture2D(RT, oUv0 + vTexelSize * usedTexelED[t]); gl_FragColor = cAvgColor; }