From 94de2291e005f1c646fd779e8d32b2820e22e071 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 31 Jul 2020 16:54:31 -0700 Subject: *: 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. --- sample.fs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 sample.fs (limited to 'sample.fs') 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); +} -- cgit v1.2.3