#ifdef GL_ES #extension GL_OES_texture_3D : enable precision mediump int; precision mediump float; precision mediump sampler3D; #endif #define USE_OGRE_FROM_FUTURE #include SAMPLER2D(RT, 0); SAMPLER3D(noiseVol, 1); OGRE_UNIFORMS( uniform vec4 lum; uniform float time; ) MAIN_PARAMETERS IN(vec2 oUv0, TEXCOORD0) MAIN_DECLARATION { vec4 oC; oC = texture2D(RT, oUv0); //obtain luminence value oC = vec4_splat(dot(oC, lum)); //add some random noise oC += vec4_splat(0.2) * (texture3D(noiseVol, vec3(oUv0 * vec2_splat(5.0), time))) - vec4_splat(0.05); //add lens circle effect //(could be optimised by using texture) float dist = distance(oUv0, vec2(0.5, 0.5)); oC *= vec4_splat(smoothstep(0.5, 0.45, dist)); //add rb to the brightest pixels oC.rb = vec2(max(oC.r - 0.75, 0.0) * vec2_splat(4.0)); gl_FragColor = oC; }