asciiblaster- draw irc art in your web browser |
git clone git://git.acid.vegas/asciiblaster.git |
Log | Files | Refs | Archive | README |
brush.txt (2084B)
1 BRUSH SHADERS 2 ============= 3 4 Unless noted, these shaders were written to work on the brush itself. 5 Make sure "brush" is selected and "animate" is checked. 6 7 8 >> distressed texture brush 9 10 Sample use of the "choice" function to get a random color. 11 12 var char = choice(" abcdef ") 13 lex.bg = +choice("0124") 14 lex.fg = +choice("01234") 15 lex.char = char 16 lex.opacity = char == " " ? 0 : 1 17 18 19 20 >> foggy terrain brush 21 22 var char = choice(" abcdef ") 23 lex.bg = choice([14,15]) 24 lex.fg = choice("367") 25 lex.char = char 26 lex.opacity = char == " " ? 0 : 1 27 28 29 30 >> mirror brush (left-right) 31 32 NOTE: Animate this on the canvas, then draw: 33 34 if (x > w/2) { 35 lex.assign( canvas.aa[y][w-x] ) 36 } 37 38 39 40 >> mirror brush (up-down) 41 42 NOTE: Animate this on the canvas, then draw: 43 44 if (x > h/2) { 45 lex.assign( canvas.aa[h-y][x] ) 46 } 47 48 49 50 >> rainbow stardust brush 51 52 Uncheck BG and animate this to brush: 53 54 lex.fg = hue(t) 55 lex.char = choice(" ,'.,.','****** ") 56 57 58 59 >> noise brushes, works on a black background: 60 61 lex.bg = max(5, yellow(randint(t))) 62 lex.opacity = lex.bg == colors.black ? 0 : 1 63 64 65 66 >> simple rainbow: 67 68 if (lex.bg != 1) lex.bg = randint(t) 69 lex.opacity = lex.bg == colors.black ? 0 : 1 70 71 72 73 >> self-erasing: 74 75 if (lex.bg != 1) lex.bg = yellow(randint(t)) 76 lex.opacity = lex.bg == colors.black ? 0 : 1 77 78 79 80 >> cycling rainbow brush 81 82 if (lex.bg != 1) lex.bg = hue( all_color_hue_order.indexOf( color_names[ lex.bg ] ) + 1 ) 83 lex.opacity = lex.bg == colors.black ? 0 : 1 84 85 86 87 >> "stars" brush.. set your brush to paint just the character "#" 88 89 if (lex.char == "#") { 90 lex.fg = hue(randint(15)) 91 lex.char = random() > 0.1 ? " " : "+@*.,\"+'*-"[randint(10)] 92 } 93 94 95 96 >> use fg char to mask mask what you're drawing on the bg 97 98 if (lex.char != "/") { lex.bg = 1 } 99 100 101 102 >> sharded glitch brush 103 104 Example: http://asdf.us/z/kksnvs.png 105 106 Use on a brush: 107 108 lex.bg = t/y/x 109 lex.opacity = lex.bg % 1 ? 0 : 1 110 111 112 113 >> incremental brush 114 115 Set your brush to be the ^ character, square, about 10x10 116 Draw "char" only 117 Then animate this shader on the canvas: 118 119 if (lex.char=="^") { 120 lex.bg += 1 121 lex.char = " " 122 } 123 lex.bg += 1 124 125 126