|
Last change
on this file since 12404 was
12115,
checked in by wiesep, 7 years ago
|
|
Changed folder structure, deletet some unused files and cleaned up code
|
|
File size:
571 bytes
|
| Line | |
|---|
| 1 | #version 150 |
|---|
| 2 | |
|---|
| 3 | out vec4 fragColour; |
|---|
| 4 | |
|---|
| 5 | uniform sampler2D RT; |
|---|
| 6 | uniform sampler3D noiseVol; |
|---|
| 7 | |
|---|
| 8 | in vec2 oUv0; |
|---|
| 9 | uniform vec4 lum; |
|---|
| 10 | uniform float time; |
|---|
| 11 | |
|---|
| 12 | void main() |
|---|
| 13 | { |
|---|
| 14 | vec4 oC; |
|---|
| 15 | oC = texture(RT, oUv0); |
|---|
| 16 | |
|---|
| 17 | //obtain luminence value |
|---|
| 18 | oC = vec4(dot(oC,lum)); |
|---|
| 19 | |
|---|
| 20 | //add some random noise |
|---|
| 21 | oC += 0.2 *(texture(noiseVol, vec3(oUv0*5,time)))- 0.05; |
|---|
| 22 | |
|---|
| 23 | //add lens circle effect |
|---|
| 24 | //(could be optimised by using texture) |
|---|
| 25 | float dist = distance(oUv0, vec2(0.5,0.5)); |
|---|
| 26 | oC *= smoothstep(0.5,0.45,dist); |
|---|
| 27 | |
|---|
| 28 | //add rb to the brightest pixels |
|---|
| 29 | oC.rb = vec2(max(oC.r - 0.75, 0)*4); |
|---|
| 30 | |
|---|
| 31 | fragColour = oC; |
|---|
| 32 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.