Tuesday, February 18, 2014

Deferred irradiance light probes

For a real-time graphics simulation, global illumination has always been a very difficult problem to solve. Interaction of the surfaces in a scene based on the light sources, diffuse reflections of the surfaces and light energy bouncing off geometry according it's material properties is usually not a trivial task to solve in real time. Several approximation solution exists, but only a small handful of them are practically applicable for performance-critical applications, such as 3D games and simulations.
I always feel nostalgic for the beautiful views of the old indoor games, lit with performant and convincing technique called "light mapping". There are several issues and limitations with it as well, but at least it was fast, and looked great for static environments. Static regarding light properties (color, range, movement and light animation of any kind.) and the scene geometry.
They eat up a lot of texture memory as well, and do not combine well with normal mapping and other per-pixel effects. Lighting is also not per-pixel perfect, but rather per-texel. Anyways, I really needed a real-time solution for my game, so I decided to experiment with light probes, rendered as deferred lights, spread across critical areas. Those probes are generated using cubemaps, rendered at probe's positions that are further converted and stored as spherical harmonics coefficients. I basically spread light probes automatically across an area (or only on key areas) calculate the incoming light at those points, send this data and shade affected pixels
This is only one bounce of indirect light. It could be extended to several bounces, which would look much better on complex scenes, and the real-time cost (performance) should be the same.
The following screen shots show the famous Sponza model, lit with that technique with GI turned on and off for comparison.


I will describe the technique in more details and provide source snippets in further posts.

No comments:

Post a Comment