
Raytraced Global Illumination and Direct Illumination – is it worth it?

Raytracing offers stunning lighting and shadows, but not without trade-offs in performance and complexity. Find out what those are!
In offline rendering used in movies, pathtracing was used as a natural way of solving DI and GI. This is the most accurate way of calculating lighting in the scene. For a long time, due to hardware limitations, it was unrealistic to run raytracing in a real-time environment, much less a complete pathtracing solution. However, as hardware improved, it became possible to use raytracing and even calculate bounced lighting with clever techniques, such as importance sampling.
Advantages of raytraced DI and GI:
– Lighting cost is no longer tied to the amount of lights so that authoring lights can be more dynamic
– Reduces iteration time of light authoring. The result of placing a light in an editor is instantaneous
– Raytraced shadows are more accurate and allow to simulate penumbras better
– Avoids issues with light leaks (can still happen with voxel solutions)
– GI solution can be used for real-time reflections
– Better representation of volumetric physical properties, such as absorption and refraction, in volumetric effects, e.g., fog, ice, water, etc.
Disadvantages of raytraced DI and GI:
– Even on modern hardware, it’s still an expensive technique
– Introduces a lot of noise to the lighting, which requires separate denoisers to fix
– GPU representation of the scene needs to be updated, and that can be expensive when used with things like vertex animation and skeletal meshes
– Materials might need to be prepared separately for both rasterisation and ray-tracing
– Raytracing is dependent on temporal data, which requires proper handling to avoid unwanted artifacts
Why do we separate DI and GI in raytracing?
– Some techniques can use different algorithms for DI and GI
– GI scales quickly with the number of light bounces, while DI doesn’t
– It allows to fine-tune both solutions to get the best performance
– GI and DI have different noise profiles
– It’s possible to set up DI not to require material samples while GI needs it to perform calculations
Links, if you want to learn more:
Realtime Global Illumination in Enshrouded (video):
RayTracing in One Weekend (book)
RayTracing Denoising
A Gentle Introduction to ReSTIR: Path Reuse in Real-time