Last change
on this file since 12206 was
12115,
checked in by wiesep, 6 years ago
|
Changed folder structure, deletet some unused files and cleaned up code
|
File size:
739 bytes
|
Rev | Line | |
---|
[12115] | 1 | #version 150 |
---|
| 2 | |
---|
| 3 | in vec4 pos; |
---|
| 4 | in vec2 oUv0; |
---|
| 5 | out vec4 fragColour; |
---|
| 6 | |
---|
| 7 | uniform sampler2D RT; |
---|
| 8 | uniform sampler3D chars; |
---|
| 9 | uniform vec2 numTiles; |
---|
| 10 | uniform vec2 iNumTiles; |
---|
| 11 | uniform vec2 iNumTiles2; |
---|
| 12 | uniform vec4 lum; |
---|
| 13 | uniform float charBias; |
---|
| 14 | |
---|
| 15 | void 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.