Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/GLSL150/NightVisionFP.glsl @ 12115

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

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

File size: 571 bytes
Line 
1#version 150
2
3out vec4 fragColour;
4
5uniform sampler2D RT;
6uniform sampler3D noiseVol;
7
8in vec2 oUv0;
9uniform vec4 lum;
10uniform float time;
11
12void main()
13{
14        vec4 oC;
15        oC = texture(RT, oUv0);
16       
17        //obtain luminence value
18        oC = vec4(dot(oC,lum));
19       
20        //add some random noise
21        oC += 0.2 *(texture(noiseVol, vec3(oUv0*5,time)))- 0.05;
22       
23        //add lens circle effect
24        //(could be optimised by using texture)
25        float dist = distance(oUv0, vec2(0.5,0.5));
26        oC *= smoothstep(0.5,0.45,dist);
27       
28        //add rb to the brightest pixels
29        oC.rb = vec2(max(oC.r - 0.75, 0)*4);
30       
31        fragColour = oC;
32}
Note: See TracBrowser for help on using the repository browser.