Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Cg/NightVisionFP.cg @ 12373

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

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

File size: 617 bytes
RevLine 
[12115]1sampler2D RT : register(s0);
2sampler3D noiseVol : register(s1);
3
4float4 NightVision_ps(  float4 pos : POSITION,
5      float2 TexCoord : TEXCOORD0,
6                        uniform float4 lum,
7                        uniform float time) : COLOR
8{       
9        float4 oC;
10        oC = tex2D(RT, TexCoord);
11       
12        //obtain luminence value
13        oC = dot(oC,lum);
14       
15        //add some random noise
16        oC += 0.2 *(tex3D(noiseVol, float3(TexCoord*5,time)))- 0.05;
17       
18        //add lens circle effect
19        //(could be optimised by using texture)
20        float dist = distance(TexCoord, float2(0.5,0.5));
21        oC *= smoothstep(0.5,0.45,dist);
22       
23        //add rb to the brightest pixels
24        oC.rb = max (oC.r - 0.75, 0)*4;
25       
26        return oC ;
27}
Note: See TracBrowser for help on using the repository browser.