advanced

#22 Reflections

Raymarching with reflection bounces

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

Try this shader live in the Shader Sandbox editor with real-time preview.
Open in Sandbox

Source Code


    
← Previous Domain Warping Next → Soft Shadows

All Tutorials