Last change
on this file since 12232 was
12115,
checked in by wiesep, 6 years ago
|
Changed folder structure, deletet some unused files and cleaned up code
|
File size:
588 bytes
|
Line | |
---|
1 | //------------------------------- |
---|
2 | //BrightBloom_ps20.cg |
---|
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 += f(Color) |
---|
7 | //------------------------------- |
---|
8 | |
---|
9 | float4 main(float2 texCoord: TEXCOORD0, |
---|
10 | uniform sampler RT: register(s0) |
---|
11 | ) : COLOR { |
---|
12 | float4 tex = tex2D(RT, texCoord); |
---|
13 | |
---|
14 | tex -= 1; |
---|
15 | float4 bright4= -6 * tex * tex + 2; //float4 bright4= ( -3 * tex * tex + 1 ) * 2; |
---|
16 | float bright = dot( bright4, float4( 0.333333, 0.333333, 0.333333, 0) ); |
---|
17 | tex += bright + 0.6; |
---|
18 | |
---|
19 | return tex; |
---|
20 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.