|
Last change
on this file since 12091 was
12091,
checked in by wiesep, 7 years ago
|
|
Updated programs and adjusted Material to work with GLSL>150
|
|
File size:
633 bytes
|
| Rev | Line | |
|---|
| [12091] | 1 | #version 300 es |
|---|
| 2 | precision mediump int; |
|---|
| 3 | precision mediump float; |
|---|
| 4 | |
|---|
| 5 | out vec4 fragColour; |
|---|
| 6 | |
|---|
| 7 | uniform sampler2D RT; |
|---|
| 8 | uniform lowp sampler3D noiseVol; |
|---|
| 9 | |
|---|
| 10 | in vec2 oUv0; |
|---|
| 11 | uniform vec4 lum; |
|---|
| 12 | uniform float time; |
|---|
| 13 | |
|---|
| 14 | void main() |
|---|
| 15 | { |
|---|
| 16 | vec4 oC; |
|---|
| 17 | oC = texture(RT, oUv0); |
|---|
| 18 | |
|---|
| 19 | //obtain luminence value |
|---|
| 20 | oC = vec4(dot(oC,lum)); |
|---|
| 21 | |
|---|
| 22 | //add some random noise |
|---|
| 23 | oC += 0.2 *(texture(noiseVol, vec3(oUv0*5.0,time)))- 0.05; |
|---|
| 24 | |
|---|
| 25 | //add lens circle effect |
|---|
| 26 | //(could be optimised by using texture) |
|---|
| 27 | float dist = distance(oUv0, vec2(0.5,0.5)); |
|---|
| 28 | oC *= smoothstep(0.5,0.45,dist); |
|---|
| 29 | |
|---|
| 30 | //add rb to the brightest pixels |
|---|
| 31 | oC.rb = vec2(max(oC.r - 0.75, 0.0)*4.0); |
|---|
| 32 | |
|---|
| 33 | fragColour = oC; |
|---|
| 34 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.