#ifdef GL_ES precision mediump int; precision mediump float; #endif #define USE_OGRE_FROM_FUTURE #include SAMPLER2D(inRTT, 0); MAIN_PARAMETERS IN(vec2 oUv0, TEXCOORD0) MAIN_DECLARATION { vec3 avgLum = texture2D(inRTT, vec2(0.5, 0.5)).rgb; //Perceptual Effects in Real-time Tone Mapping: Equ(11) gl_FragColor = vec4(saturate(vec3_splat(1.0) - vec3_splat(1.0) / (avgLum * vec3_splat(0.1) + vec3_splat(1.0))) + vec3_splat(0.1), 1.0); }