Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Example/GLSL150/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: 824 bytes
Line 
1#version 150
2
3//-------------------------------
4//BrightBloom_ps20.glsl
5// High-pass filter for obtaining lumminance
6// We use an aproximation formula that is pretty fast:
7//   f(x) = ( -3 * ( x - 1 )^2 + 1 ) * 2
8//   Color += Grayscale( f(Color) ) + 0.6
9//
10// Special thanks to ATI for their great HLSL2GLSL utility
11//     http://sourceforge.net/projects/hlsl2glsl
12//-------------------------------
13
14uniform sampler2D RT;
15out vec4 fragColour;
16in vec2 oUv0;
17
18void main()
19{
20    vec4 tex;
21    vec4 bright4;
22    float bright;
23   
24    vec2 texCoord = oUv0.xy;
25
26    tex = texture( RT, texCoord);
27    tex -= 1.00000;
28    bright4 = -6.00000 * tex * tex + 2.00000;
29    bright = dot( bright4, vec4( 0.333333, 0.333333, 0.333333, 0.000000) );
30    tex += (bright + 0.600000);
31
32    fragColour = tex;
33}
Note: See TracBrowser for help on using the repository browser.