Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Example/GLSL/BrightBloom2_ps20.glsl @ 12083

Last change on this file since 12083 was 12083, checked in by wiesep, 6 years ago

Reorganised shader programs

File size: 790 bytes
Line 
1//-------------------------------
2//BrightBloom_ps20.glsl
3// High-pass filter for obtaining lumminance
4// We use an aproximation formula that is pretty fast:
5//   f(x) = ( -3 * ( x - 1 )^2 + 1 ) * 2
6//   Color += Grayscale( f(Color) ) + 0.6
7//
8// Special thanks to ATI for their great HLSL2GLSL utility
9//     http://sourceforge.net/projects/hlsl2glsl
10//-------------------------------
11
12uniform sampler2D RT;
13
14void main()
15{
16    vec4 tex;
17    vec4 bright4;
18    float bright;
19   
20    vec2 texCoord = vec2( gl_TexCoord[0] );
21
22    tex = texture2D( RT, texCoord);
23    tex -= 1.00000;
24    bright4 = -6.00000 * tex * tex + 2.00000;
25    bright = dot( bright4, vec4( 0.333333, 0.333333, 0.333333, 0.000000) );
26    tex += (bright + 0.600000);
27
28    gl_FragColor = tex;
29}
Note: See TracBrowser for help on using the repository browser.