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:
576 bytes
|
Line | |
---|
1 | #version 150 |
---|
2 | |
---|
3 | uniform sampler2D inRTT; |
---|
4 | uniform sampler2D inBloom; |
---|
5 | uniform sampler2D inLum; |
---|
6 | |
---|
7 | in vec2 oUv0; |
---|
8 | out vec4 fragColour; |
---|
9 | |
---|
10 | // declare external function |
---|
11 | vec4 toneMap(in vec4 inColour, in float lum); |
---|
12 | |
---|
13 | void main(void) |
---|
14 | { |
---|
15 | // Get main scene colour |
---|
16 | vec4 sceneCol = texture(inRTT, oUv0); |
---|
17 | |
---|
18 | // Get luminence value |
---|
19 | vec4 lum = texture(inLum, vec2(0.5)); |
---|
20 | |
---|
21 | // tone map this |
---|
22 | vec4 toneMappedSceneCol = toneMap(sceneCol, lum.r); |
---|
23 | |
---|
24 | // Get bloom colour |
---|
25 | vec4 bloom = texture(inBloom, oUv0); |
---|
26 | |
---|
27 | // Add scene & bloom |
---|
28 | fragColour = vec4(toneMappedSceneCol.rgb + bloom.rgb, 1.0); |
---|
29 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.