Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/GLSL150/ASCIIFP.glsl @ 12181

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

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

File size: 739 bytes
Line 
1#version 150
2
3in vec4 pos;
4in vec2 oUv0;
5out vec4 fragColour;
6
7uniform sampler2D RT;
8uniform sampler3D chars;
9uniform vec2 numTiles;
10uniform vec2 iNumTiles;
11uniform vec2 iNumTiles2;
12uniform vec4 lum;
13uniform float charBias;
14
15void main()
16{
17    vec3 local;
18
19        //sample RT
20        local.xy = mod(oUv0, iNumTiles);
21        vec2 middle = oUv0 - local.xy;
22        local.xy = local.xy * numTiles;
23       
24        //iNumTiles2 = iNumTiles / 2
25        middle = middle + iNumTiles2;
26        vec4 c = texture(RT, middle);
27       
28        //multiply luminance by charbias , beacause not all slices of the ascii
29        //volume texture are used
30        local.z = dot(c , lum)*charBias;
31       
32        //fix to brighten the dark pixels with small characters
33        //c *= lerp(2.0,1.0, local.z);
34       
35        c *= texture(chars, local);
36        fragColour = c;
37}
Note: See TracBrowser for help on using the repository browser.