Dynamic GI won't update when loading a scene

Hi,

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.

1 Like

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.

Also this only happens in build, not in editor.

Perhaps. What are your specs and which version of Unity are you using?

My development pc:
Ryzen 9 5900X
32gb ram
GTX 1080 Ti (waiting for my RTX 3080 since October :p)
M.2 SSD hard drive
Windows 10 pro

The pc the build is supposed to run on:
i7 8700K
8gb ram
GTX 1070 Ti
SATA SSD hard drive
Customized Windows 10 pro with shell replacement

I have tried 2020.3.1, 2020.3.4 and 2021.1.3.

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.

1 Like

Well they probably were planning on deprecating it, so, didn’t pay much attention to bug fixing till now is what I guess :frowning:

@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’ll see if I have enough space on google drive or dropbox. Should I then just include the link in the bug report?

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.

2 Likes

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.

https://discussions.unity.com/t/845794

It’s still happening in 2021.2.0b2. Realtime Gi can broke when you load scene, when you hit Play, etc… Somebody do something with Enlighten!

1 Like