SDF Ray-Marching and Fractal Images
Use Signed Distance Functions and ray-marching to produce interesting images with fractal properties, difficult to produce with rasterization. Many effects from ray-tracing, like shadows, can also be achieved with this model.
Goals
The rough goal is to end up with a scene, or a handful of scenes, demonstrating the various neat effects that can be achieved with ray-marching. Think demoscene-esque visuals.
Core
- Render basic primitives such as Spheres, Cuboids, Polyhedra, Tori, etc.
- Render combinations of shapes, through SDF union, intersection, difference, etc.
- Use a basic lighting model (e.g. Phong)
- Add basic shadows using ray-marching
- Animate the scene, having both the camera move and primitives change
- Include a basic fractal effect, such as modular repetition
Extensions
- Add controls for moving the camera with mouse, keys
- Implement soft shadows, mimicking penumbra
- Implement fog, to make the image look a bit nicer
- Implement reflections using ray-marching
- Add soft intersection and union of primitives
- Use different colors for different primitives
- Use procedural textures (e.g. checkerboards, stripes)
- Use noise to create more interesting textures (wood, marble, etc.)
- Use noise to create an SDF for terrain
- Combine primitives artistically to create a character model
- Add distortion to primitives, such as twists, or displacement
- Add glow effects using ray-marching
- Use more complicated fractal repetition, such as space folding
- Implement interesting fractals, like sponges or julia sets
- Implement volumetric primitives, like clouds, or ice
- Implement some ambient occlusion
Schedule
Week 0
- Lúcás (Shadows)
- Mohamed (Basic primitives)
- Noah (Phong Lighting)
Week 1
- Lúcás (fog, reflections)
- Mohamed (Combining SDFs (union, difference, intersection, etc.))
- Noah (Basic fractal effect, distortions)
Week 2
- Lúcás (Different colors for primitives, procedural texturing)
- Mohamed (Soft Combinations, soft shadows, beginning modelling work)
- Noah (Noise based terrain)
Week 3
- Lúcás (Fractals, ambient occlusion)
- Mohamed (glow effects, basic volumetric effects)
- Noah (space folding)
Week 4
- All (Making artistic scenes 8^)
Resources
The vast majority of our code is going to end up in a fragment shader, so apart from the basic boilerplate of setting up a WebGL pipeline, we're not going to be using any external libraries. On the other hand, we will shamelessly inspire ourselves from all of the many resources on ray-marched SDFs
Libraries
- regl.js (Maybe? We might also just setup a simple pipeline ourselves, we just need two triangles :P)
Resources