summaryrefslogtreecommitdiff
path: root/doc/shaders/util.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc/shaders/util.txt')
-rw-r--r--doc/shaders/util.txt25
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/shaders/util.txt b/doc/shaders/util.txt
new file mode 100644
index 0000000..d192652
--- /dev/null
+++ b/doc/shaders/util.txt
@@ -0,0 +1,25 @@
+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.
+