Hello, everyone. I’d like to start a thread about my unique solution for dynamic Global Illumination. I showed this technique off recently at GDC, and it was quite well-received, so I figured I’d share some information about it here.
Unity 5’s integration of Enlighten offers incredible image quality at an amazingly low run-time cost, but because it relies on precomputation, many developers are unable to leverage it in their games, especially if their scenes are being procedurally generated at run-time. If you’re working on a procedurally generated game, or a game that otherwise is very dynamic, I believe that my algorithm may be a fantastic solution for you.
I don’t quite have a name for the technique yet, but it’s basically a variation of Reflective Shadow Maps. I originally developed the algorithm back when I was working on lighting for Minecraft. Due to the dynamic nature of Minecraft, I needed a fully dynamic solution that didn’t rely on precomputation.
Here’s the current simplistic state of the algorithm. The scene is rendered from the view of the light source at hand and information about each surface receiving illumination is stored. That information is then accessed in a post-process effect to generate the final bounced light and then blended using the albedo buffer (thank you Unity 5 for deferred rendering!).
Here’s a few screenshots of the effect.
As you can see, the technique yields very spatially-coherent results with quite good close-proximity detail. The cool thing is that it’s calculated on-the-fly, so any material, lighting, or geometry changes are reflected immediately in the indirect lighting. Another strength of this algorithm is that it works very well for large outdoor scenes, because of its spacial coherency and retention of detail. Here are some comparisons showing the effect on and off in The Viking Village.
So, how’s it perform? At the settings in these screenshots, this effect is running at around 6 ms on a GTX 980 at 1080p. It is very scalable, however, and can cost as little as 2.5 ms and as much as 10 ms depending on quality settings.
Some of the drawbacks are:
-Limited to a single bounce and a “simulated” second bounce (works well enough)
-Currently only works for directional lights. I’m looking to find a solution for other light types
-Only surfaces lit directly by sunlight cast indirect light
-Does not (and cannot in its current state) handle indirect occlusion/shadows
As quality settings increase, the result approaches each surface giving off a single perfectly accurate bounce of light without visibility/shadowing. Lowering quality consists of reducing radius of indirect light, reducing resolution of buffers for coarser approximation of surfaces, reducing sampling rate at the risk of low-frequency noise, and decreasing draw distance of the effect.
Because I am also working on updating my SE Natural Bloom & Dirty Lens asset and working on finishing my SSAO asset, development may be slowed. I’m aiming to release this as an asset in the near future. Because of GDC, most of the preliminary work is done. I have an idea for a more lightweight approach, but that may have to wait until the initial version is released.
Please, let me know what you think! If you have any questions, feel free to ask them.