Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/archive/skybox/Media/materials/programs/hdr_finalToneMapping.glsl @ 11183

Last change on this file since 11183 was 390, checked in by landauf, 17 years ago

added materials

File size: 559 bytes
Line 
1uniform sampler2D inRTT;
2uniform sampler2D inBloom;
3uniform sampler2D inLum;
4
5varying vec2 uv;
6
7// declare external function
8vec4 toneMap(in vec4 inColour, in float lum);
9
10void main(void)
11{
12        // Get main scene colour
13    vec4 sceneCol = texture2D(inRTT, uv);
14
15        // Get luminence value
16        vec4 lum = texture2D(inLum, vec2(0.5, 0.5));
17
18        // tone map this
19        vec4 toneMappedSceneCol = toneMap(sceneCol, lum.r);
20       
21        // Get bloom colour
22    vec4 bloom = texture2D(inBloom, uv);
23
24        // Add scene & bloom
25        gl_FragColor = vec4(toneMappedSceneCol.rgb + bloom.rgb, 1.0);
26   
27}
28
Note: See TracBrowser for help on using the repository browser.