Skip to content

kfahn22/mandelbulb

Repository files navigation

Mandelbulb

This code uses renders the mandelbulb in P5.js using a signed distance function in a shader. The launch point is the Coding Train Mandelbulb challenge by Daniel Shiffman. The frag files also incorporate code written by Inigo Quilez, Martyn Steinrucken, and/or Jamie Wong.

1. The Spherical function and mandelbulbSDF track as closely as possible to the code written by Daniel Shiffman.

2. Inigo Quilez has done pioneering work on shaders and is the co-creator of shadertoy. I have used some of his techniques in the .frag file. His website contains a wealth on information on shaders.

3. Martijn Steinrucken has some wonderful wonderful shader tutorials on youtube. I have used his ray marching starting point in the one and three color versions. If you want a really good explanation of ray marching, I highly recommend you watch his video on the topic!

4. The lighting and ray marching code in the crystal version of the mandelbulb comes from Jamie Wong.

5. Mandelbulb with Multiple color options

This p5.js sketch renders the mandelbulb with several different color options. The color is a function of the iterations in the mandelbulbSDF and the parameters in the vec3 that holds the colors. Here are a few of the best color combinations I have found.

Pastel Mandelbulb Pink and Purple Mandelbulb Aqua Mandelbulb Green and Purple Mandelbulb Purple Aqua Mandelbulb Purple Mandelbulb Bright colors Mandelbulb Raspberry Mandelbulb

6. Three color Mandelbulb

Three Color Mandelbulb

7. Single color Mandelbulb

Single Color Mandelbulb

8. "Crystal" Mandelbulb

Crystal Mandelbulb

9. Future Improvements

  • Try to address aliasing.
  • Try to implement true edge detection
  • Work on generalizing mandelbulb SDF algorithm to other powers (it currently only works for n=8)
  • Try to animate "crystal" version

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published