After a ray hits a surface in raymarching, compute a reflection ray using the GLSL reflect() function: reflect(rd, normal). Then march again from the hit point along the reflected direction. Each bounce accumulates color and loses energy via a reflectivity factor, simulating metallic and mirror-like surfaces.
Key Concepts
reflect() function
multi-bounce rays
reflectivity attenuation
recursive marching
Try this shader live in the Shader Sandbox editor with real-time preview.