DEVOURED
Lighting That Feels Just Right
Maxime Heckel details the implementation of probe-based Global Illumination in the browser to add color bleeding and indirect light to 3D scenes.
What: The article walks through moving from screen-space approximations to a more stable probe-based system that uses compute shaders to capture light data in world space.
Why it matters: Indirect lighting is the missing piece for high-fidelity browser 3D; probe-based methods allow for stable light bounces that persist even when the camera moves or off-screen objects interact.
Takeaway: If you are working with Three.js, review their native probe-based GI implementation for a production-grade alternative to the custom code presented here.
Deep dive
- Screen-Space vs. Probe-Based: Screen-space GI fails for off-camera objects; probes solve this by pre-computing light in 3D grid volumes.
- Temporal Accumulation: Uses history textures and hysteresis to blend results over time, reducing noise without the massive performance cost of full path tracing.
- Sky Light: Incorporates atmospheric scattering to provide a natural environmental tint to the indirect light.
- Reflections: Uses ray-traced reflection rays against the probe atlas to simulate complex light bounces on shiny surfaces.
- Compute Shaders: Leverages WebGPU-like TSL (Three.js Shading Language) to handle the compute-heavy tasks of updating probe light estimations.
Decoder
- Global Illumination (GI): A set of techniques that simulate how light bounces off surfaces to illuminate other objects, rather than just calculating direct light from sources.
- Path Tracing: An algorithm that simulates light paths to create realistic images, computationally expensive but visually accurate.
- Hysteresis: A process where the current state depends on past values; here, it controls the blend ratio between new light samples and historical data to prevent flickering.
- Schlick Fresnel: An approximation used to calculate how much light is reflected off a surface based on the viewing angle; essential for realistic material look.
Original article
Full article content is not available for inline reading.
Explore all 56 articles in today's digest
Fresh dev news, AI-digested daily. Never miss a trend at devoured.fyi