About
This program produces randomly generated pixel shaders, which in turn are used to produce the images you see on this page. The shader is made by generating the Abstract Syntax Tree; Lisp's homoiconicity makes this far easier than it would be in other languages.
The shaders are produced like a context-free grammar, each function call's parameters can either be a variable, a constant, or another function call. The available variables are the cartesian and polar coordinates, and a random value assigned to the color channel so images aren't always black and white.
Below is an example shader and the image it produces.
To prevent divide-by-zero crashes some functions are replaced with a wrapped
version, these are the w-*
functions you'll see
in the example.
Example Shader and Image
(lambda (x y r theta c)
(w-mod
(l2-norm c 422.53055
(max
(sin
(w-mod
(l2-norm (w-mod theta (* 246 (w-cosh y)))
(w-mod theta theta)
(*
(w-cosh
(abs
(w-and 758.96893
(min (divide (w-log r) x)
923.49615))))
39)
(+ x (min (divide c (max c 172)) x)))
(cos y)))
(w-mod y r))
x)
r))