Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/data_extern/programs/GLSL120/BrightBloom2_ps20.glsl @ 12412

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

Changed folder structure, deletet some unused files and cleaned up code

File size: 726 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;
13varying vec2 oUv0;
14
15void main()
16{
17    vec4 tex;
18    vec4 bright4;
19    float bright;
20
21    tex = texture2D(RT, oUv0);
22    tex -= 1.00000;
23    bright4 = -6.00000 * tex * tex + 2.00000;
24    bright = dot( bright4, vec4( 0.333333, 0.333333, 0.333333, 0.000000) );
25    tex += (bright + 0.600000);
26
27    gl_FragColor = tex;
28}
Note: See TracBrowser for help on using the repository browser.