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.

yGGC8VzKMi1182ZvrD-50WfIe-XGXabGD2zw5Ue7WzK44oVmVq6ak3bEVt-kheiWy5nPMzvssty2YBcVVLuE4djm6qbyAHoVRAnzOdzoukIMHwTjl9DxkG_PqoeAEYRCGOZXqKJQf0BkETLBijCcAww


Under details of the light source, search for “Mobility” and click on “Static”.

7yMCbIRkS0wvfG_0w4gJradAWixX4sBST285w-jQS-96l7DWbpo7IEGpa720zMS388rgtYWO0FwoViKFNJ4wdQfRI-L7bKHPRc4F1RX5pQdZtcYerwnObRgb_YpoqHHocIW_AYwv1opQCj-55QPsi-4


Now, head to “Project Settings” and locate the “Static Lighting” option. Ensure that it is enabled by ticking the checkbox.

6wqrsFRLjKCaTBnrLMqf94s8Mc5Yr63IlFMB2-qQ3yf74hh4eYJ5WFMycUffvjCGpG9sjcKHn4XT8bLvrPi1qF07eG0gN58sa62JXtu6E-KVkO0DW1bb2WCL5MoZQEAeQyPiw6kEhLb2Pb3F3pEfQTQ


Next, find “World Settings” under the settings in the upper right corner of the screen.

_nVd2mUGQ4LXcaWbYvVW50BwfLJJs4kRNiIe3Ir2FbwHiHp_iggsyPniajrFasXbPBlPwKvhjG80L1DYD4h5DonrfWCrR40tHgM1C_IUZKLDM-oTOqKr8913xG0MQVHbb-YP3UqIy3T320iHVHxlZcI


In World Settings, locate “Ambient Occlusion” and ensure it’s enabled by checking the box.

wxgoRDdb50VcytHU5Cs28jnLHBu8suiTzmYxvAUA9QKHNxBffP9dR2y_DxaNcfQ8c4G7HegqYwEjcPqMkTys4POG5vZatJzO8ul_EkuFXOMpqmJuY83RCWDtudxSWBrInE5paFpCfdSTVch7YtnJMig


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.

L5E37SAVmDApPvJDOojNTo_Wm44mGO2_PXDm97VRCgUx8LnQ-vg_wnmMiC032TtCBxbtO5alOWruU-cD_zcPS9A26MutVqSUSYFbJW6-0CAuMcKN-wfFQkJzPdIawb1g8izIQY9L2cVnGcM4mb9qjO8


Turn off “Enable Virtual Texture Light Maps” in project settings, as shown below.

nJ1hVWq55htW9nMdVYL_OHxdJSyaHOdvsGufxkzjz-tcWjSXjE-fLwZHyrPEX20S-yKap5MFCoZHQ77LE7AoYMaIM9auWynQiSf90QVDlVBXC89dvS7FaK2SFm9XA7QxohA-9HSs09VaWDYDW7gB9t8


Also, ensure that “Lumen” is turned off. 

MFGDH89ITDGKImYaMTdgaDR2hdj2KpFz_GyXIwuD53R-6NLWRyzTUwQzxd99qy7KpbtCUKPwHHLi7Sebf81TQKjeQ6fIDCbZct4CWiTmArbPXmdBkI_92TStVETCpC7gwIHIAyqNZj1EPRfYvXEbQjQ


Once you have adjusted your project's light settings, go to Build → Build Lighting Only.

ucD1XNlDhCVOiBWAWQC8Oamu8n3t3W0-bd_-GFHvD9JZEqQHscleZfDRz7iMJhKOyJbiI5YsNb9DrFgP4Ks-gk6WZmcJ5-tWxUhnMzYmvnrIvnxZ79Tn5bMWuSbuo5HKO64njN6QuBSLpphb19WlMWo


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.

eJxGjSeCnizwVqheKq-XnokG0_YT8wIHvD2Uw1PocZkKkZttgCNACw9BWFMmNOmp0SFtUDOt7QONiHSVwcav12c62U-cZXS3_SuNtxKDD-za_wjSJ8dKi5WU9zcHzO2KBsFjtk-rwfFn66wxd_LdJ5s


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.

g0LEGiUIvWEhe6uvPBUHeG7tHVxxsHK3rpzQeg6LjMid4UwUtoP4AnVeZ_EonatVvof9fDmb4HvpNjwU1WtMbeUghuYmDgvJfMslgPYY9SNPspoxL2bnfrNxyJimBnP2nDb1TNUILzRVWe9GEbmhFGw

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