Based on Superformula driven by Signal Generators, which has been number 1 in my favorites in YT since I first saw it.
The shape is computed in the vertex shader. Shading has per-fragment lambert and specular lighting, 12-tap poisson sampled shadowmapping and environment mapping. Post-processing performs bloom, FXAA and vignetting and a bit of noise.
I'm pretty sure there's something wrong in my implementation of the supershape, there´s too many degenerate cases, and some parameters that should create a specific shape are wrong.
Code available on GitHub.
Each equation has its own n1, n2, n3, m, a and b parameters, and a button to randomize them.
Play with the params:
- randomize: create a complete random shape (might be completely degenerated!)
- animateLight: move the light source around.
- animateShape: morph between different shapes.
- gridOpacity: opacity of the grid in the final render.
- animationSpeed: speed multiplier for the animation speed.
- post: toggle postprocessing.