I’ve been trying the Progressive CPU light mapping option, and it is VERY SLOW. Generating a light map for the scene using Enlighten (Deprecated), as I’ve done in the past, takes about 45 minutes. I don’t really know how long it takes using Progressive CPU as I’ve not yet seen it finish. After starting and stopping several times, I let it go and walked away. I came back to my machine about 3 hours later to find the progress indicator about where it was when I left, about a 1/4 of the way finished. And while it’s running, I can do pretty much nothing on my machine, everything grinds to a halt. Not the case with Enlighten. Is this normal? How much slower should I expect Progressive CPU to be compared to Enlighten? Orders of magnitude slower?
Apparently neither of the light mappers continue working when the computer goes to sleep, so apparently walking away and letting it render is not the way to do it.
I have a late 2015 iMac, and am using the standard shader with a normal map. The static objects in the scene all share one material. There are 4 lights in the scene. This project is in Unity 2021.1.10. I have an M1 Max Mac Studio on order, will that speed the lightmapping process up?
First you must know that the CPU lightmapper is just for high-end cpu because of its quality
Enlighten is faster in very low preset without Final Gather. With a high preset and Final Gather it is much slower than CPU lightmapper
2two things will affect on your bake time: Indirect Samples Lightmap resolution
So first use most lower lightmap resolution and use the default indirect samples and 1024 lightmap size to see the lightmap quality. If the quality was not good, so increase the lightmap resolution…
If you had noise, so increase indirect samples
You must increase lightmap resolution and indirect samples progressively step by step
If you have not a high end cpu, you can only use Enlighten in low preset
I’ve had my Mac Studio with an M1 Max running Unity 2021.2.19 (Apple Silicon) for a few weeks now, and I’m not seeing much improvement in Lightmap baking speed. In Activity monitor, when a Lightmap is baking using Enlighten, %CPU hovers around 10%, down to as low as 1%, and %GPU around 5%, occasionally bouncing up to 10-20%. I’ve haven’t done any timed comparisons, but it seems as slow as ever.
I tried Progressive GPU (Preview), the only other option available. I let it run over night, and when I came back this morning, it was right where it left off, with 3 hours (or is that 3 minutes) remaining. So apparently it still hangs if the computer goes to sleep while it’s rendering.
FWIW, in the Lighting panel, it says, “Use the Progressive Lightmapper for Baked GI in new projects. Use Enlighten Baked GI for backwards compatibility only.”
Running the Progressive GPU, it uses around 200% CPU and 30-60% GPU.
I updated to 2021.3.0f1, and am trying Progressive GPU again. Indirect samples set to 128, very low Lightmap resolution. When I started baking, the initial estimate was 19 days (I didn’t know there was a Background Tasks panel with time estimates). After running a while, it’s down to 8 hours. That still seems excessive. Especially since it looks like very little of my machine’s GPU power is being used. I assumed since GPU was in the name, it would take advantage of the the 24 graphics cores in my machine. Hopefully, it will finish this time and not freeze.
Contrary to Unity’s recommendation, I don’t think the Apple silicon version of the Progressive light mapper is ready for use in new projects. I don’t know how the results compare, since I’ve not gotten Progressive to finish, but it’s not practical for me to wait all day or all night to see the results.
You mean lightmap parameters? This does nothing for progressive lightmapper. What is the actual resolution used? (number of the “Lightmap resolution” setting)
I have a suspicion you’re not tailoring meshes well for lightmapping. Depending on the game, different meshes very much should have different lightmap settings, especially based on their size in the scene. Small objects should just be probe lit.
This per-object care is mandatory when you do not have AAA scale massive render farms for baking and only want to use a single home computer.
Yeah but my point here is… their workflow only works on renderfarms (not using Unity). So they’d have to be doing settings per mesh, to reduce time. There is no other way if using PLM.
I mean, I would still argue that it’s more of a matter of RAM usage (not hand adjusting everything will probably lead to a ton of lightmaps eating a ton of ram) rather than lack of render farm (or equivalent power).
The coupling of PLM and Enlighten setting super frustrates me (and the whole lightmap parameters thing is ill-designed), makes giving advice for settings really awkward. Even Unity themselves are often confused.
@jabaro a screenshot of your lighting settings would help.
Yes, I do have some tailoring and some tweaking to do. I’m just getting started with light mapping in this project, and it’s been a while since I’ve done it. The big difference in speed between Enlighten and Progressive GPU makes Enlighten more suitable for me, so I can see the results of a change I make within an hour versus waiting a day.
Not to mention the hanging. I’ve yet to have a Progressive Lightmap finish, so I don’t know if taking 10x longer means it’s going to be 10x better. And Enlighten is hit or miss. With Enlighten, sometimes when I walk away and come back, the Lightmap is finished, but often as not, the process is hung, not responding, and so must start over.
Progressive is on the back burner right now, but now I’m having trouble with Enlighten. It’s not finishing, but not hanging. I click Generate Lighting and I get a progress bar, and it shows up in the Background Tasks panel. Then a few seconds or minutes later, the task is gone. The button in the Lighting panel still says Cancel, but nothing’s happening. No light maps are generated. I have to quit and restart Unity to get it going again.
Get a PC with a Nvidia 3090, 24 gigs VRAM, I haven’t had a scene yet that can’t bake with that GPU. Though even if the hardware can bake a large scene doesn’t mean it will perform well. You need to lower scale for unimportant objects, use probes for smaller objects. And most important use bake tags to tag objecs, Unity will not put close by items on same lightmap resulting in more set pass calls. You need to manually fix this with bake tags. Also put LODS on same lightmap will result in fewer set pass for far away objects.
Seeing as how I just got a Mac Studio, that’s not a very helpful suggestion. No reason why an M1 Max with 10 CPU Cores and 24 GPU cores shouldn’t excel at a GPU-intensive task like this. When it only uses 5-10% of the GPU’s capability, that suggests to me it’s the software, not the hardware. Unity is not fully taking advantage my machine’s power.
It’s not just speed, it’s reliability. I’ve given up on the Progressive light mapper for now, but Enlighten has gotten flaky. This is something new, maybe since I recently updated to 2021.3.0f1. It doesn’t crash or hang, it counts down the task list and appears to finish, but nothing happens, nothing is updated. The only way to make it generate a light map again is to quit/restart Unity (fortunately that process is FAST on this machine). I can only generate 1-3 light maps before having to restart. That really slows things down.
Unfortunately the best answer to how to improve the performance of the official lightmap baking systems is to not use the official lightmap baking systems but to instead pick up a copy of Bakery. The big caveat with that of course is that it’s only capable of running on PCs with NVIDIA hardware.