Baking lights on a Unreal level in preparation for export to OKO
Version 1.0.0 (117785) - CSP 4.18.0 - UE 5.1
This article will guide you through the basics of the light baking workflow. You’ll learn how to export levels from Unreal into OKO with the lighting baked into the static elements of the level.
Instructions
Begin by checking all the lights in your scene to ensure they are set to “Static”, as demonstrated below.
Under details of the light source, search for “Mobility” and click on “Static”.
Now, head to “Project Settings” and locate the “Static Lighting” option. Ensure that it is enabled by ticking the checkbox.
Next, find “World Settings” under the settings in the upper right corner of the screen.
In World Settings, locate “Ambient Occlusion” and ensure it’s enabled by checking the box.
Next, under the Build Menu, select the desired lighting quality for your project. We recommend using 'Production' lighting quality for the final pass, so that the lightmap textures have the least amount of noise and artifacting as possible.
Turn off “Enable Virtual Texture Light Maps” in project settings, as shown below.
Also, ensure that “Lumen” is turned off.
Once you have adjusted your project's light settings, go to Build → Build Lighting Only.
This might take a few moments to process, but once it's done you’ll have successfully added light baking to your Unreal level. Make sure to save your level.
Here’s a table to keep track of which settings to adjust:
Settings | Check ✅ or Uncheck ❌ | How to Find the Setting |
Static Lighting | Check ✅ | Open the following menu: Edit → Project Settings … On the left, navigate to: Engine Settings Rendering Sub-settings In the Misc Lighting section, check “Allow Static Lighting” |
Lumen | Uncheck ❌ | Open the following menu: Edit → Project Settings … On the left, navigate to: Engine Settings Rendering Sub-settings In the Lumen section, uncheck “Use Hardware Ray Tracing when available” |
Virtual Texture Support | Uncheck ❌ | Open the following menu: Edit → Project Settings … On the left, navigate to: Engine Settings Rendering Sub-settings In the Virtual Textures section, uncheck “Enable virtual texture support” |
Ambient Occlusion | Check ✅ | Open the following menu: Edit → World Settings In the Lightmass Settings, Check “Use Ambient Occlusion” |
Additional information
Ambient occlusion
The decision to use ambient occlusion depends on the world you are lighting. Interiors with ambient-style lighting need to have the ambient occlusion setting on. However, a space or world with more direct or even more stylized multi-light spaces may not need it.
Lightmass settings
'Lightmass Settings' in the World Settings Window allows the user to tune the number of bounces, the indirect lighting quality, etc. This will have a significant influence over the final baked lightmaps. In this window, you will also find the number of output lightmaps which is critical to optimization, as by default, Unreal can generate hundreds of maps.
Each static mesh in the Outliner, when selected, has its own array of specific lightmass settings that should be tuned to better control quality, resolution, and number of lightmaps. Many small instanced static assets will typically not be lightmapped at all, as the quality of the bake will never reach a good enough visual fidelity while also being optimized. Therefore, it's best practice only to have small assets lit by light probes and not mapped.
In this section, you can also specify whether assets with emissive materials contribute to the lighting bake.
This Unreal document can be helpful in terms of determining what lightmass settings are best to tune. (Note that Unreal has been investing in GPU lightmass baking since Unreal 4.27, but the above document is still valuable for understanding lightmass settings. We also recommend exploring the use of GPU lightmass and virtual shadow textures as they can be quicker to calculate.)
For more information on exporting levels and assets into OKO using the plugin please refer to Exporting an Unreal level to OKO