Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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: 571 bytes
RevLine 
[12091]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.