I’m having a problem with real-time global illumination. Sometimes the dynamic global illumination won’t update when a level is loaded, instead everything is very dark. This happens pretty much randomly, I have no idea what could be causing this. I have tried updating manually via DynamicGI.UpdateEnvironment and RendererExtensions.UpdateGIMaterials but these have no effect, the scene remains dark. Only reloading the scene fixes the problem.
Based on that description, this sounds like a bug to me. Does this happen with multiple projects, or just 1? If you have one, that you have been able to reproduce it with, I suggest submitting a bug report.
It has happened with multiple projects based on the same master project / code base and with multiple versions of Unity. After some more testing the problem seems to be less frequent on a machine with more performance. I also tried to strip down a project to a single scene for a bug report (the whole project is over 30gb) but I can’t seem reproduce the problem with just one scene. I have to keep switching between multiple scenes for the problem to appear. Maybe something to do with memory? The lighting data assets are quite large, some are almost the maximum size.
I have this sh*t too. You load the scene, hit play, and all Gi is reset. You need exit, rebuilt light and than it’s works. Some time… It is not about memory or something. Enlighten back, but nobody even fix anyting, it’s still glitchy as hell.
@Pema-Malling is there a size limit to what can be included in a bug report? I tried including the project as a zip but it’s over 10 gigabytes. It seems to upload but then I just get a “connection closed” error at some point.
I’m honestly not sure. I’ll ask around if we have a place suitable for such large uploads. Otherwise, perhaps you could put it on google drive or something similar?
I managed to find a workaround and find a hint about the cause.
Sometimes my application does a lot of changes to materials in a scene at once, especially at the start of a scene, and I queue a change to GI with RenderExtensions.UpdateGIMaterials. Previously this was done in one frame for every material/renderer changed. I moved this functionality to a for loop in a coroutine and check for DynamicGI.isConverging after each call to UpdateGIMaterials in a while loop and do yield return null until DynamicGI.isConverging is false. Then the for loop continues to the next renderer.
So apparently something goes awry if you queue up multiple changes to dynamic GI in one frame.
What does your coroutine function look like? I’m using 2021.2.0b. I attempted your workaround but with no success to the problem I’m having, which sounds very similar to yours.