#ifdef GL_ES precision mediump int; precision mediump float; #endif #define USE_OGRE_FROM_FUTURE #include SAMPLER2D(inRTT, 0); OGRE_UNIFORMS( uniform vec2 texelSize; ) MAIN_PARAMETERS IN(vec2 oUv0, TEXCOORD0) MAIN_DECLARATION { vec4 accum = vec4(0.0, 0.0, 0.0, 0.0); accum += texture2D(inRTT, oUv0 + texelSize * vec2(-1.5, -1.5)); accum += texture2D(inRTT, oUv0 + texelSize * vec2(-0.5, -1.5)); accum += texture2D(inRTT, oUv0 + texelSize * vec2( 0.5, -1.5)); accum += texture2D(inRTT, oUv0 + texelSize * vec2( 1.5, -1.5)); accum += texture2D(inRTT, oUv0 + texelSize * vec2(-1.5, -0.5)); accum += texture2D(inRTT, oUv0 + texelSize * vec2(-0.5, -0.5)); accum += texture2D(inRTT, oUv0 + texelSize * vec2( 0.5, -0.5)); accum += texture2D(inRTT, oUv0 + texelSize * vec2( 1.5, -0.5)); accum += texture2D(inRTT, oUv0 + texelSize * vec2(-1.5, 0.5)); accum += texture2D(inRTT, oUv0 + texelSize * vec2(-0.5, 0.5)); accum += texture2D(inRTT, oUv0 + texelSize * vec2( 0.5, 0.5)); accum += texture2D(inRTT, oUv0 + texelSize * vec2( 1.5, 0.5)); accum += texture2D(inRTT, oUv0 + texelSize * vec2(-1.5, 1.5)); accum += texture2D(inRTT, oUv0 + texelSize * vec2(-0.5, 1.5)); accum += texture2D(inRTT, oUv0 + texelSize * vec2( 0.5, 1.5)); accum += texture2D(inRTT, oUv0 + texelSize * vec2( 1.5, 1.5)); // take average of 16 samples accum *= vec4_splat(0.0625); // Divide the sum to complete the average, and perform an exp() to complete // the average luminance calculation // min / max white gl_FragColor = vec4(clamp(accum.rgb, vec3_splat(0.4), vec3_splat(0.7)), 1.0); }