//------------------------------- //BrightBloom_ps20.glsl // High-pass filter for obtaining lumminance // We use an aproximation formula that is pretty fast: // f(x) = ( -3 * ( x - 1 )^2 + 1 ) * 2 // Color += Grayscale( f(Color) ) + 0.6 // // Special thanks to ATI for their great HLSL2GLSL utility // http://sourceforge.net/projects/hlsl2glsl //------------------------------- #ifdef GL_ES precision mediump int; precision mediump float; #endif #define USE_OGRE_FROM_FUTURE #include SAMPLER2D(RT, 0); MAIN_PARAMETERS IN(vec2 oUv0, TEXCOORD0) MAIN_DECLARATION { vec4 tex = texture2D(RT, oUv0); tex -= vec4_splat(1.00000); vec4 bright4 = vec4_splat(-6.00000) * tex * tex + vec4_splat(2.00000); float bright = dot(bright4, vec4(0.333333, 0.333333, 0.333333, 0.000000)); tex += vec4_splat(bright + 0.600000); gl_FragColor = tex; }