I have been trying to add some basic lighting to my unity scene, but every time I try to bake lightmaps, it gets stuck on ‘Preparing bake’.
Also, the estimated time to complete this stage continuously goes up as I wait - after about 5 minutes of waiting, the time has gone from 10 seconds to 4 hours.
I have reinstalled the recommended unity version, and tried creating an entirely new scene for testing, but the problem still happens and I cannot complete a lightmap.
I also tried lowering the lightmap resolution but this didn’t seem to help.
Baking with the GPU is what seems to crash Unity, it seems after I try GPU baking I cannot bake at all again after that, but I’m not 100% sure this is the issue.
This may help in some way, if I load the scene and do a CPU progressive bake, it works fine - but as soon as I try a GPU bake, it never progresses and unity can’t be closed
Since nobody’s asked about the thing that affects the performance the most I will:
How big is the stuff you’re lightmapping? PLM is more affected by just how big it is in 3D space. Larger objects especially larger planes or a terrain, will require vastly more conservative profiles than a profile for an indoor section.
This is where your performance is likely dying, so I’ll just ask what exactly are you throwing at it?
I tried baking a very simple scene (just a small model of a gun) which worked perfectly fine when I used progressive CPU , but as soon as I tried the progressive GPU bake , it stops working
Not sure if this is related but unity also doesn’t detect the GPU until the bake has started - I have never had this problem with other software
Beyond what is normal. (normal is likely pinheads case)
Normal being your level is set up for baking as effectively as you can at that stage
This is related to Hippocoder’s previous comment about the compositions of your objects because of PLM performance and essential knowledge to have when it comes to baking light data.
There are times, with updates, multiple projects, cache data and general looping bugs that can cause the GPU/CPUs to just cycle this bake,
in cases of 0% progression on a bake, this can be related to your GI cache data. (Possibly Extreme gamers case)
GI cache can be deleted if it’s been messed up in some way previously.
A word of warning is that GI cache is shared between projects of the same editor version
clear it only if you know it’s okay to do so.
This brings us to the looping bug: if a 2020.3 project GI bake crashed at some point, it is possible that the cache could affect all 2020.3 projects.
The main one is that GI cache is shared across all projects within the ~same editor version, or globally on a computer if you do the same lighting processes.
So you could unintentionally clear cache from another project, that you might also be working on or doing progressive bakes with.
by default, the cache is stored globally like this, but you can set it to keep it in the lighting asset itself, which would be project/scene based instead.
Don’t try to lightmap anything bigger than 200 x 200m scene - just never works
Assign at least two weeks to optimize the scene for lightmap baking (for a dense 200 x 200m scene)
Only lightmap big objects, and leave small objects for light probes
Expect it to fail and be ready to iterate
Higher quality options are not really viable because not only do they take long, but fail 99% of the time. Only raise quality when your scene is fully ready.
Don’t dream about test lightmapping on a WIP scene. It is a massive waste of time.
Lightmap will easily get corrupt. Just be ready mentally.
There will always be artifacts. Design your scene around it to hide it.