This project is a real‑time GPU raymarching experiment built with Three.js and a custom GLSL fragment shader. A full‑screen quad is rendered with a signed distance field (SDF) scene evaluated per‑pixel via sphere tracing. The scene contains three independently moving primitives—a sphere (red), a box (green), and an icosahedron (blue)—each drifting smoothly to seeded “random” X/Y positions over time. When objects overlap, both geometry and color blend smoothly using a soft‑minimum (log‑sum‑exp) distance combine, producing liquid-like merges instead of hard cutoffs. Shading is based on surface normals derived from SDF gradients, with a diffuse light term and an added Fresnel rim highlight to emphasize silhouettes. The camera uses aspect‑correct screen coordinates suitable for raymarching, and object rotation is applied as an inverse transform to keep the distance estimate stable.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| How do you integrate Signed Distance Fields (SDF) into a basic three.js scene? | 28 | 1613 | February 17, 2025 | |
| SDFs in the scene - raymarching | 31 | 950 | March 20, 2025 | |
| Raycast for meshes and SDFs | 18 | 228 | March 19, 2025 | |
| Witch's Swill [SDF, MeshStandardMaterial] | 3 | 199 | February 19, 2025 | |
| Gpgpu points into metaballs | 10 | 593 | May 18, 2024 |
