mirror of
https://github.com/lalbornoz/roar.git
synced 2024-12-24 21:26:37 +00:00
39 lines
688 B
Plaintext
39 lines
688 B
Plaintext
SHADER UTILITIES
|
|
================
|
|
|
|
These are little snippets which may be useful in writing your own shaders.
|
|
|
|
|
|
|
|
>> basic way to slow the frame rate of a shader.
|
|
|
|
window.zz=window.zz||0
|
|
if(!(x+y)) zz++
|
|
if (lex.bg != 1 && !(zz % 4)) {
|
|
...
|
|
}
|
|
|
|
|
|
>> handy for brushes - use color to mask brush shape
|
|
|
|
lex.opacity = lex.bg == colors.black ? 0 : 1
|
|
|
|
|
|
Tip: Set to "animate brush", then use option+shift (alt+shift) to
|
|
copy color from the canvas. Brush will have the "shape" of the
|
|
copied color only. Can be a cool effect when used with fg/bg only.
|
|
|
|
|
|
|
|
>> copy color from canvas at x/y
|
|
|
|
lex.assign( canvas.get(x,y) )
|
|
|
|
|
|
|
|
>> animate canvas up and to the left..
|
|
|
|
lex.assign( canvas.get(x+1,y+1) )
|
|
|
|
|