Ray marching in GLSL
Ray marching draws 3D with distances. For every pixel a ray steps forward until it touches a shape. You go from one ray to a lit scene with normals, shadows and materials.
- The rayA camera, one ray per pixel. The sky is its direction.
- The sphereAn SDF: a formula that measures how far the surface is.
- The marchThe ray takes safe steps. Here you see how hard it works.
- NormalsWhich way the surface faces. The orientation map.
- LightDiffuse: the face looking at the light lights up.
- The floorA plane + min(). Two shapes share one scene.
- ShadowA second ray toward the light. If it hits, shadow.
- Two shapessmin(): two spheres melting into one.
- MaterialColor by position + a sharp specular highlight.
- Full sceneEverything together + the light orbits with time. FINALE.