Progressive Lightmapper keeps restarting, only finishes when Unity is out of focus

I noticed a strange problem with the Progressive Lightmapper when working on a map for our mobile game. It is a simple scene created from 3d tile pieces and some props (trees, rocks, etc.). Lightmapping was working fine, until at some point (after I had added more props) it stopped baking properly. “Preparing Bake…” progress bar is shown but it keeps restarting indefinitely. Strangely, when I switch away from Unity to another program (can be anything, like an Explorer window when Unity is still visible), I can see that the bake goes over the “preparing bake” and bakes normally. If I switch back to Unity when the bake is in progress, it will get restarted again. The same happens on three different computers, so it is not specific to the computer.

Enlighten bake finishes normally, but it is dog-slow and produces worse results, so I wouldn’t be using it anyway. There is nothing special about the scene, as I said this is a mobile game so very simple stuff really. I have grass shader that wiggles vertices of the grass meshes, which could in theory cause this, because the geometry keeps changing, but toggling “animated materials” on the scene view doesn’t help - and it did work at first until it just stopped working.

Any ideas? :slight_smile: Lightmapping settings are as shown:

Judging from the screenshot, you are using an old Unity version, where the Progressive lightmapper was still in the preview stage. It is expected that you’d run into issues like this. Please upgrade to a new version of Unity and see if the issue reproduces.

Good point, I intended to include version but forgot. We’re still on 2017.4 LTS for the moment, but yeah we do need to switch over to 2018 LTS at some point during this year. It may very well be a solved problem, but it’s something I hadn’t seen before. We do have more complex scenes as well and those bake without issue, so this one is a bit strange indeed.