Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Cg/ASCIIFP.cg @ 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: 792 bytes
Line 
1sampler2D RT : register(s0);
2sampler3D pattern : register(s1);
3
4float4 ASCII_ps( float4 pos : POSITION,
5      float2 TexCoord : TEXCOORD0,
6                        uniform float2 numTiles,
7                        uniform float2 iNumTiles,
8                        uniform float2 iNumTiles2,
9                        uniform float4 lum,
10                        uniform float charBias) : COLOR
11{
12    float3 local;
13
14        //sample RT
15        local.xy = fmod(TexCoord, iNumTiles);
16        float2 middle = TexCoord - local.xy;
17        local.xy = local.xy * numTiles;
18       
19        //iNumTiles2 = iNumTiles / 2
20        middle = middle + iNumTiles2;
21        float4 c = tex2D(RT, middle );
22       
23        //multiply luminance by charbias , beacause not all slices of the ascii
24        //volume texture are used
25        local.z = dot(c , lum)*charBias;
26       
27        //fix to brighten the dark pixels with small characters
28        //c *= lerp(2.0,1.0, local.z);
29       
30        c *= tex3D(pattern,local);
31        return c;
32}
Note: See TracBrowser for help on using the repository browser.