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.
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.
- 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