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 | |
---|
14 | uniform sampler2D RT; |
---|
15 | out vec4 fragColour; |
---|
16 | in vec2 oUv0; |
---|
17 | |
---|
18 | void 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.