Become as Skilled as Iq in Distance Functions and Shapes
Become as Skilled as Iq in Distance Functions and Shapes
-
Solidify the mathematical foundations
Signed Distance Functions (SDFs) are grounded in geometry, not mere tricks. Deepen these areas:
- Euclidean geometry (distance formulas for points, lines, circles, spheres)
- Analytic geometry (equations and distances for planes, lines, circles, ellipses)
- Linear algebra (projections, rotation matrices, orthonormal bases)
- Metric spaces & norms (not only L2, but also L1, Lp, etc.)
-
Master an SDF “repertoire”
Iq’s strength is combining a vast library of shape SDFs. Grow your repertoire in this order:
- Primitives: sphere, box, cylinder, torus
- Transforms: translation, rotation, reflection, scaling
- Composition:
min
(union),max
(intersection), smooth-min (smooth union) - Applications: metaballs, repetition (tiling via
mod
), folding (fractalization)
-
Bridge theory and implementation
- Theoretical: prove/derive general forms for distance functions (e.g., point–plane distance via a normal dot product).
- Practical: render SDFs in GLSL or p5.js (advance a ray and draw the hit point via ray marching).
-
Trace the history and ideas
Understanding the lineage before and after Iq deepens insight:
- History of geometry (Euclid, Descartes, Gauss)
- Evolution of computer graphics (Blinn’s implicit surfaces, Perlin noise)
- Modern SDF uses (game collision, font rendering, physics simulation)
-
Practical ways to learn
- On Shadertoy, copy and modify code by Iq and other authors.
- In p5.js, try 2D SDFs to build the intuition of “drawing with a distance field.”
- Study with both math and CG books:
- Math: Convex Optimization (Boyd); Geometry and the Imagination (Hilbert)
- CG: Ray Tracing in One Weekend (Peter Shirley); Real‑Time Rendering (Akenine‑Möller)
-
Build thinking habits
Keep asking: “How can I express any given shape as a distance function?” Examples:
- Star shape →
min
over several rays - Heart shape → combine a circle with a sine function
- Outline of the Japanese archipelago → a circle SDF distorted with noise
- Star shape →
Comments
Post a Comment