Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/GLSL150/hdr_finalToneMapping.glsl @ 12232

Last change on this file since 12232 was 12115, checked in by wiesep, 6 years ago

Changed folder structure, deletet some unused files and cleaned up code

File size: 576 bytes
Line 
1#version 150
2
3uniform sampler2D inRTT;
4uniform sampler2D inBloom;
5uniform sampler2D inLum;
6
7in vec2 oUv0;
8out vec4 fragColour;
9
10// declare external function
11vec4 toneMap(in vec4 inColour, in float lum);
12
13void 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.