Last change
on this file since 12181 was
12115,
checked in by wiesep, 6 years ago
|
Changed folder structure, deletet some unused files and cleaned up code
|
File size:
672 bytes
|
Line | |
---|
1 | #version 150 |
---|
2 | |
---|
3 | uniform sampler2D inRTT; |
---|
4 | uniform vec2 texelSize; |
---|
5 | |
---|
6 | in vec2 oUv0; |
---|
7 | out vec4 fragColour; |
---|
8 | |
---|
9 | void main(void) |
---|
10 | { |
---|
11 | |
---|
12 | vec4 accum = vec4(0.0); |
---|
13 | vec4 LUMINENCE_FACTOR = vec4(0.27, 0.67, 0.06, 0.0); |
---|
14 | |
---|
15 | // Get colour from source |
---|
16 | accum += texture(inRTT, oUv0 + texelSize * vec2(-0.5, -0.5)); |
---|
17 | accum += texture(inRTT, oUv0 + texelSize * vec2(-0.5, 0.5)); |
---|
18 | accum += texture(inRTT, oUv0 + texelSize * vec2(0.5, 0.5)); |
---|
19 | accum += texture(inRTT, oUv0 + texelSize * vec2(0.5, -0.5)); |
---|
20 | |
---|
21 | // Adjust the accumulated amount by lum factor |
---|
22 | float lum = dot(accum, LUMINENCE_FACTOR); |
---|
23 | |
---|
24 | // Take average of 4 samples |
---|
25 | lum *= 0.25; |
---|
26 | fragColour = vec4(lum, lum, lum, 1.0); |
---|
27 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.