I have a project set up for Android in Unity 2019.2.21.
I am using Gamma color space & LWRP.
And Progressive GPU lighmapper.
I am trying light my scenes with baked lightmaps combined with just a couple of lightprobes.
I am using low poly assets with a few materials, nothing special. I created 2 scenes this way with no issues. The more visible stuff gets a lightmap, small insignificant thins get lit by probes. I had to change the scale in lightmap propery though, on a few occasions, but managed to get good results, and Unity was responsive, too. In the third one I am using more area,(a bigger ground and more houses, trees props etc) thus I am using more lightmapsā¦
TLDR:
Tried lowering settings, decrease lighmap size etc and using probes for more objects with no luck.
Also tried adding more virtual memory to the paging file in windows.
Deleted GI cache, restarted PC.
Problems:
-baking process gets stuck on Preparing bake, but Unity is responsive
-Unity freezes up
-comes up with a Windows out of memory message and crashes
But on a few occasions it baked in seconds with no probs.
@uy3d I would also like to know. Will this be back ported to 2019.4? Our project is becoming unusable due to light probe usage and baking works about 10% of the time now
So to get this straight, a pretty serious bug that getās in the way of a pretty big aspect of the engine is not being solved in the Longtime support version? So itās either move to 2020 and deal with all the bugs and preview stuff in that or stick with LTS and deal with this pretty severe bug.
Please try the latest 2019.4 LTS version, you are on 2019.2 which doesnāt have as many bugfixes. If the problem persists please file a bug report. Thanks!
Iām also having this issue occasionally with 2019 LTS. Started at a lightmap size of 512 and it baked fine in 5 seconds or so. Went up in increments to 2048 and it bogged down in āPreparing to bakeā. I aborted, then went back to 512 (clearing the data) and it sat in āpreparing for bakeā for 6-8 minutes while the CPU pegs at 95% or so. When itās actually baking with the GPU the CPU use is negligible. If I wait that full 6-8 minutes on a lower setting, then bakes just fine with the GPU on every manual iteration of Generate Lighting. I was definitely using my GPU as the baking device.
I went through this whole cycle a few times but after restarting Unity, I canāt replicate it anymore. Exiting and reloading helps when this happens, then Iām back to normal speeds on 2k or 4k maps.
This happens for quite a few versions now. The first bake of the day happens consistently fast, then something gets stuck and eventually it becomes really slow or unresponsive. It has been happening on multiple projects, on multiple machines, in multiple Unity versions.
There probably is no bug report, because there is no point in making a bug report, since if the issue is not 100% reproducible, then it might as well not exist.
Next youāll tell me you still think that interactive / progressive updating still works.
I hate to say just forget about itā¦ but Bakery really is many times better. The only problem is that baking isnāt as fast, but it is way higher quality, for less runtime memory usage.
We have just recently fixed an issue where progressive bakes were not working for the first bake of an editor session, regardless of the lighting settings.
Bakery GPU is actually faster & uses less GPU memory than Progressive GPU, it also results in higher quality lightmaps, though that part is a bit subjective. (and offers other optional features like SH directional lightmaps, as first seen in the Frostbite engine on Battlefront 2).
We put them head to head comparing results with image diff tools and measuring bake times at different settings, in order to decide what lightmapper to use for production on a very large project (this was in 2018.x unity).
We had scenes that Progressive GPU could not bake, and the Progressive CPU was not an option because it would take multiple days to complete.
Bakery can still run out of memory, but will still handle more than what Progressive GPU can.
Bakery is not a 100% drop in replacement though IMO, but it depends on the scope of the project. There are still occasional artifacts that can show up from the denoiser and other issues, so a non-programmer may encounter problems that would otherwise be easily solved with use of a debugger and small code fixes in your project.
The downside to Bakery is it has to work around Unityās lightmap storage arrays which are cumbersome to work with, so the C# codebase is a bit of a mess. On serious projects, developers may have to alter how Bakery loads in lightmaps to work with how you are storing and loading assets from bundles etc. (we had to)
The way lightmaps (and in general any per-object render data) is stored within Unity could use a full rethink & opening up to users for customization, as it would benefit serious developers greatly, but Iām unaware of any efforts toward that.
btw, I actually found this thread because a project using 2019.4.4f1 is getting the stuck on āPreparing Bakeā¦ā indefinitely issue.
On 3 different computers, with 2 different projects using built-in I have not seen progressive baking work 99% of the time (since 2019LTS), the only times it actually updated anything was when I had very low sample settings and filtering on, which is kinda useless.
The lighting settings store the prioritize view flag. It didnāt matter whether the flag was enabled or not, every first bake of an editor session wasnāt picking it up and defaulting to view prioritization being disabled. After the bake finished, the flag would be picked up, and subsequent bakes would do view prioritization if it was enabled in the lighting settings.
Prioritize view is called āprogressive updatesā in recent versions of Unity.
Iām confused on whether with the flag off Iām supposed to see any updating. It used to be that the whole map was slowly updating when the flag was off, and with the flag on it was doing the parts that were visible in the scene view first.
Now, with the flag off, there is no updating happening at any time. Bake starts, and at some point it ends.
When checking āProgressive Updatesā, I get updates but only in the parts visible in the scene view. (after the first bake as you said, due to the bug).
What is the intended behaviour when the flag is off?
I wasnāt clear enough. Letās take filtering and denoising out of the equation and assume that I have those off.
With Progressive Updates OFF and filtering OFF, if I press bake, am I supposed to see any updates happen to the lighting as it bakes? ā The current behavior in my experience is that if I have both of those off, I press bake, then I see absolutely nothing change for the duration of the bake, and then suddenly, after the bake is complete, I see the final lightmap.