Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Example/GLSLES/NightVisionFP.glsles @ 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: 633 bytes
Line 
1#version 300 es
2precision mediump int;
3precision mediump float;
4
5out vec4 fragColour;
6
7uniform sampler2D RT;
8uniform lowp sampler3D noiseVol;
9
10in vec2 oUv0;
11uniform vec4 lum;
12uniform float time;
13
14void main()
15{
16        vec4 oC;
17        oC = texture(RT, oUv0);
18       
19        //obtain luminence value
20        oC = vec4(dot(oC,lum));
21       
22        //add some random noise
23        oC += 0.2 *(texture(noiseVol, vec3(oUv0*5.0,time)))- 0.05;
24       
25        //add lens circle effect
26        //(could be optimised by using texture)
27        float dist = distance(oUv0, vec2(0.5,0.5));
28        oC *= smoothstep(0.5,0.45,dist);
29       
30        //add rb to the brightest pixels
31        oC.rb = vec2(max(oC.r - 0.75, 0.0)*4.0);
32       
33        fragColour = oC;
34}
Note: See TracBrowser for help on using the repository browser.