From b43c2e4d13f2db81af291404766d720c729e1bf6 Mon Sep 17 00:00:00 2001 From: degasus Date: Mon, 11 Mar 2013 00:47:43 +0100 Subject: [PATCH] use correct color in ascii ari shader still slow as hell, but it looks much nicer sorry neobrain :-P --- Data/User/Shaders/asciiart.txt | 86 ++++++++++++++++++++++++---------- 1 file changed, 61 insertions(+), 25 deletions(-) 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