Last change
on this file since 12091 was
12091,
checked in by wiesep, 6 years ago
|
Updated programs and adjusted Material to work with GLSL>150
|
File size:
790 bytes
|
Line | |
---|
1 | #version 100 |
---|
2 | precision mediump int; |
---|
3 | precision mediump float; |
---|
4 | |
---|
5 | //------------------------------- |
---|
6 | //BrightBloom_ps20.glsles |
---|
7 | // High-pass filter for obtaining luminance |
---|
8 | // We use an approximation formula that is pretty fast: |
---|
9 | // f(x) = ( -3 * ( x - 1 )^2 + 1 ) * 2 |
---|
10 | // Color += Grayscale( f(Color) ) + 0.6 |
---|
11 | // |
---|
12 | // Special thanks to ATI for their great HLSL2GLSL utility |
---|
13 | // http://sourceforge.net/projects/hlsl2glsl |
---|
14 | //------------------------------- |
---|
15 | |
---|
16 | uniform sampler2D RT; |
---|
17 | varying vec2 oUv0; |
---|
18 | |
---|
19 | void main() |
---|
20 | { |
---|
21 | vec4 tex; |
---|
22 | vec4 bright4; |
---|
23 | float bright; |
---|
24 | |
---|
25 | tex = texture2D(RT, oUv0); |
---|
26 | tex -= 1.00000; |
---|
27 | bright4 = -6.00000 * tex * tex + 2.00000; |
---|
28 | bright = dot( bright4, vec4( 0.333333, 0.333333, 0.333333, 0.000000) ); |
---|
29 | tex += (bright + 0.600000); |
---|
30 | |
---|
31 | gl_FragColor = tex; |
---|
32 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.