Periodic Spaces
8 days ago
- #SDF
- #GraphicsProgramming
- #RayMarching
- Domain repetition is a technique for rendering an infinite number of shapes in real-time using SDFs (Signed Distance Functions).
- The key insight is that ray marching evaluates only one shape at a time, not all shapes simultaneously.
- Traditional domain repetition uses discrete cells, which can lead to visual artifacts when shapes cross cell boundaries.
- Using periodic functions like triangle waves or sine waves can create continuous, artifact-free repetitions.
- Triangle waves produce correct distance fields by mirroring shapes at each period boundary.
- Sine waves create smooth, nonlinear repetitions but may distort distance fields near edges.
- Radial symmetry can also benefit from periodic functions, avoiding sharp discontinuities.
- Classic instanced repetition allows sampling multiple adjacent cells to handle shapes that span boundaries.
- Periodic functions are limited to repeating the same shape and cannot handle shapes spanning multiple cells.
- The technique is useful for cheap approximations of smoothly merged repeated surfaces.