Luoshuang's GPULightmass

Hi All,
Happy New Year for 2024,

buildlighting.rar (700 Bytes)
This is a way to get bigger baked light builds on your current hardware on Unreal Engine 5.3 and onwards

So here is a Windows 10/11 batch file. This uses to 5.3 binary release.
If you have forgotten to put in the LPGU 5.3 patches

Then will run CPU Llightmass instead, if not LGPU patched

If you need to just take the code open
$ notepad buildlighting.bat

REM uncomment the command below for silent bat build
REM ECHO OFF
REM This command below will build Baked Lighting from the command line
REM This will increase the VRAM available on Nvidia GPU allowing larger projects to be baked.
REM
REM You MUST have the Luoshuang’s GPULightmass 5.3 patches loaded documented on the Epic Forum at
REM https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/2489
REM 
REM Replace Owner with your UserName path
REM Replace StarterMap.umap with the umap you use to bake your lighting.
REM If you have not added the patches the CPU Lightmass will be run.
REM This is NOT for use with Epic GPULightmass which uses DX12 DXR Shaders
REM The command is below the output is in local file projlog.txt
REM DO NOT remove the double quotes in the command below
REM Print start time
ECHO Print Start time in minutes
TIME/T

"C:\Program Files\Epic Games\UE_5.3\Engine\Binaries\Win64\UnrealEditor-Cmd.exe" "C:\Users\Owner\Documents\Unreal Projects\MyProject 5.3\MyProject.uproject" -run=resavepackages -buildlighting -allowcommandletrendering -map=/Game/Maps/StarterMap.umap >projlog.txt

REM print end time
time/T

There has been requests to get the original UE4 Lighting command line builder to work with UE5.
So here is a Windows 10/11 batch file. This uses to 5.3 binary release.
If you have forgotten to put in the LPGU 5.3 patches

Then will run CPU Llightmass instead, if not LGPU patched

You must in all Lightmass adjust the PoolSizeVRAMPercentage=0 to save GPU VRAM as described in
How to Improve Texture Streaming GPU performance in UE5

This command line does not speed up the LGPU build. This way of building does not start the Unreal Editor and therefore saves the GPU VRAM and processing graphics. There is a very quick startup, because it removes the loading of the UE Editor and selection of the project, then opening the project.

I will admit there are other special commands to build sections i.e. only single maps, BUT when I tried opening the UE editor afterward I got the red message to Rebuild Lighting making the builds invalid. This is due to shadows that overlap not being taken into consideration as each map is built.

Therefore in my opinion this is a conflict that can only be resolved by using
Place Actors → Volumes → Lightmass Importance Volumes and adjust the area previously described in detail by another user in this thread

This procedure could probably on a fairly large machine allow you to do other work. I have noticed a significant speed (approximately 10%) up in CPU Lightmass but nothing else

Summary

This is a way to get bigger baked light builds on your current hardware on Unreal Engine 5.3 and onwards

4 Likes