CPU Lightmass generates different lighting results on a landscape if executed via a commandlet vs through the editor

We recently migrated from Unreal Engine 5.4 to 5.5.4, and started encountering unusual lighting issues with our baked lightmaps. One of the most prominent and consistent artifacts was that the landscape was not receiving any baked lighting. Additionally, we observed broken shadowmaps in a specific level.

Our lighting bake process is automated via a build machine that runs overnight using the ResavePackages commandlet.

After further investigation, we discovered that if the Swarm cache is populated by baking lightmaps through the commandlet, the cache becomes “poisoned,” resulting in incorrect lighting in subsequent bakes. In contrast, if the cache is first populated through the Editor, the results are correct. This is why it’s crucial to clear the Swarm cache between experiments to observe the different outcomes accurately.

The issue appears to be related to the interaction between the landscape and the skylight—particularly when the skylight uses a cubemap, which makes the problem much more noticeable.

We reproduced this behavior using a small test project created with a vanilla version of UE 5.5.4, which demonstrates the issue when lightmaps are baked using the method outlined below:

E:\UE_5.5\Engine\Binaries\Win64\UnrealEditor-Cmd.exe -project=E:\Vanilla\bakelight\bakelight.uproject -run=resavepackages -AllowCommandletRendering abslog=E:\Vanilla\baketest\bakelight\Saved\Logs\baketest.log -unattended -buildlighting -Quality=High -buildreflectioncaptures -buildtexturestreaming -Map="/Game/SimpleTest/SimpleMap"

The issue occurs regardless of the selected quality level.

Below are screenshots showing the differences in lighting results in the test scene. Nothing within the project was modified—only the lightmap baking method changed.

All screenshots were captured using Low quality settings to better highlight the discrepancies in the lightmaps.

Steps to Reproduce
Using the provided test project:

  • Clear your Swarm cache (this step is very important)

    • Delete everything under: %APPDATA%\Local\UnrealEngine\5.5\Saved\Swarm
  • Bake the lightmaps using the ResavePackages commandlet.

  • Take a screenshot of the results for reference.

  • Clear your Swarm cache again (still very important)

    • Delete everything under: %APPDATA%\Local\UnrealEngine\5.5\Saved\Swarm
  • Bake the lightmaps in the Editor using the menu option.

  • Compare the results and observe the differences.

Hello,

Thank you for reaching out.

I’ve been assigned this issue, and we will be looking into this Lightmass discrepancy for you.

Hello,

Thank you for reporting this. I can confirm this issue can be reproduced as described in the latest CL, and have opened a bug report:

The tracker will be visible after it is approved internally at Epic Games and is publicly accessible.

Epic offices will be closed for summer break from Monday, June 30, 2025 to Friday, July 11, 2025 and reopen on Monday, July 14, 2025.

If you have any further questions, please let us know.