Search Unity

Realtime GI and occlusion culling suddenly not working in one scene (Solved)

Discussion in 'Editor & General Support' started by raincoil, May 12, 2017.

  1. raincoil

    raincoil

    Joined:
    Nov 5, 2016
    Posts:
    4
    So I've been developing a game for a while now, and I've been working mostly in this specific test scene of mine.
    I've been using precomputed realtime GI and occlusion culling throughout working in this scene. Computing the GI would take a some minutes, and the occlusion culling worked great.
    A couple days ago, when I made a build for someone and tested it out, I noticed the GI was absent in the build.
    I checked back in Unity and the GI wasn't there anymore either.
    So I went to redo it. Started it up, and it was taking an extremely long time, when before it took like, maybe 10 minutes, maybe less. I cancelled it because I figured something must have been wrong. After cancelling, the GI progress bar wouldn't disappear until I exited Unity. I tried to figure this problem out, why it was taking so long, but couldn't.
    Then I noticed my occlusion culling stopped working. I saw in the visualization it was only culling lights, and it didn't seem to be using frustum culling at all, unless I disabled occlusion culling. The geometry of the scene would barely get culled, only sometimes would some pieces be culled if I moved to random areas in the map.
    I decided I'd just wait for the GI to see if it would finish. It took maybe a couple hours, taking almost all 32 GB of my RAM most of the time. It acted as if I was baking tons of direct light or something, but that was unchecked, I just had the realtime GI on. Then it finally finished... I tried out the scene, and... nothing. There was no GI, it just seemed to have done nothing for a very long time.
    This happened suddenly. I had made no changes to the project that led to this stuff occurring. The only thing I did, to my knowledge, was make a build.

    Here are some webms demonstrating what happened with occlusion culling.
    What it was like before. I was showing someone the dynamic occlusion portals used with opening/closing doors:
    https://puu.sh/vJ6cJ/9fc8aac786.webm
    What it suddenly became:
    https://puu.sh/vNhOL/2598a56846.webm
    As you can see, frustum culling only seems to work when I switch off occlusion culling. And when occlusion culling is on, lights seem to be culled kind of alright, but geometry culling is sparse and inconsistent. Might be hard to see but I'm opening and closing the same door as in the first webm.

    I switched to a different, old scene to test it out. Occlusion culling worked perfectly, GI took about 10 seconds to generate... I've tried loading the offending scene in other versions of Unity, copying the project, reimporting the assets, clearing occlusion culling and GI data, moving the GI cache, changing settings in culling and GI, making resolution as small as possible, switching directional mode to non-directional, none of it made a difference. As far as I know, my assets are all entirely intact, normal, and working.

    So does it sound like this scene just got totally messed up somehow? Or perhaps I accidentally toggled the "break GI and occlusion" setting somewhere?
     
  2. raincoil

    raincoil

    Joined:
    Nov 5, 2016
    Posts:
    4
    I found out and fixed the problem. What a crock of S***, to be honest...
    Anyway, it was this: https://forum.unity3d.com/threads/u...mode-numerous-thread-created-recently.453916/
    All my static meshes had turned to "combined meshes". I guess I probably had canceled a build partway through and that caused this bug to appear. I went through and changed all the meshes back manually.
    So now that it's fixed, GI takes less than a minute. Actually a lot quicker than I remember, considering the scene isn't really small. Occlusion culling seems to be working as well. Also, the combined meshes had made my scene 17 MB when it was originally only 1. So now it's back to normal there too.