summaryrefslogtreecommitdiff
path: root/sample.fs
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-07-31 16:54:31 -0700
committerVito Caputo <vcaputo@pengaru.com>2020-07-31 16:54:31 -0700
commit94de2291e005f1c646fd779e8d32b2820e22e071 (patch)
tree988bb9fde53a73edf948dd14fec07802a2f42406 /sample.fs
parentcd7e9ebd9675461f59d5f7a9c7c0a9a1a0536d12 (diff)
*: initial implementation of pig
This is nothing to write home about, but it provides a little sandbox for developing shader-generated textures in the spirit of shadertoy or the demoscene tool bonzomatic. It's more oriented towards developing shaders for use with libstage in the small games I've been hacking on.
Diffstat (limited to 'sample.fs')
-rw-r--r--sample.fs20
1 files changed, 20 insertions, 0 deletions
diff --git a/sample.fs b/sample.fs
new file mode 100644
index 0000000..e3e0701
--- /dev/null
+++ b/sample.fs
@@ -0,0 +1,20 @@
+#version 120
+
+uniform float alpha;
+uniform float time;
+uniform float T;
+uniform vec3 color;
+uniform float seed;
+uniform float rand;
+
+void main()
+{
+ float len = min(length(gl_TexCoord[0].st), 1.f);
+ vec3 c = color;
+ float a = alpha;
+
+ len *= T;
+ a *= (1.f - (len * len * len * len * len * len * len));
+
+ gl_FragColor = vec4(a * c, a * alpha);
+}
© All Rights Reserved