Skip to content

Instantly share code, notes, and snippets.

@JonathanSmith
Created October 11, 2009 01:41
Show Gist options
  • Save JonathanSmith/207316 to your computer and use it in GitHub Desktop.
Save JonathanSmith/207316 to your computer and use it in GitHub Desktop.
(defmap rgb-color-fractal
(let [val %
z (.xy val)
n (.z val)
normalized-count (/ (- n (log2 (log2 (sqrt (+ (* (.x z) (.x z)) (* (.y z) (.y z)))))))
(float max-iterations))]
(? (< 4.0 (dot z z))
(color3 normalized-count normalized-count (mix 0.2 1.0 normalized-count))
(color3 0.0 0.0 0.0))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment