- Home /
Realtime Global Illumination with procedural objects
I set my scene with "precomputed realtime GI" and then, I've tried to set as "static" the objects that I instantiate in runtime, while playing in my scene. But, the GI doesn't work.
What is the right way to set the GI with procedural gameobjects?
Answer by Cherno · Jun 09, 2015 at 05:03 PM
What you are trying to do it sadly not possible. the so-callced "Realtime Global Illumination" is not truly real-time, it won't work with procedurally generated objects. This limitation is officially described in the User Manual for GI.
:( Ok, that's sad for me. Thank you so much for your answer Cherno.
Yes. From the manual:
Additionally, Unity 5.0 adds support for a new technique called Precomputed Realtime GI. It still requires a precomputation phase similar to the bake mentioned above, and it is still limited to static objects. However it doesn’t just precompute how light bounces in the scene at the time it is built, but rather it precomputes all possible light bounces and encodes this information for use at runtime. So essentially for all static objects it answers the question “if any light hits this surface, where does it bounce to?” Unity then saves this information about which paths light can propagate by for later use. The final lighting is done at runtime by feeding the actual lights present into these previously computed light propagation paths.
This means that the number and type of lights, their position, direction and other properties can all be changed and the indirect lighting will update accordingly. Similarly it’s also possible to change material properties of objects, such as their color, how much light they absorb or how much light they emit themselves.
While Precomputed Realtime GI also results in soft shadows, they will typically have to be more coarse-grained than what can be achieved with Baked GI unless the scene is very small. Also note that while Precomputed Realtime GI does the final lighting at runtime, it does so iteratively over several frames, so if a big a change is done in the lighting, it will take more frames for it to fully take effect. And while this is fast enough for realtime applications, if the target platform has very constrained resources it may be better to to use Baked GI for better runtime performance.