diff --git a/Data/User/Shaders/asciiart.txt b/Data/User/Shaders/asciiart.txt index 269163f89f..3f9ff03966 100644 --- a/Data/User/Shaders/asciiart.txt +++ b/Data/User/Shaders/asciiart.txt @@ -4,6 +4,7 @@ uniform sampler2D samp9; const int char_width = 8; const int char_height = 13; const int char_count = 95; +const int char_pixels = char_width*char_height; const vec2 char_dim = vec2(char_width, char_height); const vec2 font_scale = vec2(1.0/char_width/char_count, 1.0/char_height); @@ -17,43 +18,78 @@ void main() vec2 char_pos = floor(uv0*resolution.xy/char_dim); vec2 pixel_offset = floor(uv0*resolution.xy) - char_pos*char_dim; - float minc = 0; - float mindiff = char_width*char_height*100; - float diffsum[char_count]; - - vec4 color_avg = vec4(0.0, 0.0, 0.0, 0.0); + float mindiff = char_width*char_height*100; // just a big number + float minc = 0.0; + vec4 mina = vec4(0.0, 0.0, 0.0, 0.0); + vec4 minb = vec4(0.0, 0.0, 0.0, 0.0); for(int i=0; i