# Unreal Engine 4 and 5 Lightmass iussues

**URL:** <https://community.cesium.com/t/unreal-engine-4-and-5-lightmass-iussues/22130>\
**Category:** Cesium for Unreal\
**Created:** [January 30, 2023, 8:57am UTC](https://community.cesium.com/t/unreal-engine-4-and-5-lightmass-iussues/22130 "2023-01-30T08:57:42Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![karlsson.adam](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/karlsson.adam/32/11887_2.png) [@karlsson.adam](https://community.cesium.com/u/karlsson.adam)\
**Post date:** [January 30, 2023, 8:57am UTC](https://community.cesium.com/t/unreal-engine-4-and-5-lightmass-iussues/22130/1 "2023-01-30T08:57:42Z")

</div>

Hi,  
I have problems building lighting in Unreal Engine 4.27. The same error is also received in 5.x. The lightmass is crashing, have anyone else had this problem?

LightingResults: Error: === Lightmass crashed: ===  
Assertion failed: (Index \>= 0) & (Index \< ArrayNum) [File:D:\Build++UE4\Sync\Engine\Source\Runtime\Core\Public\Containers/Array.h] [Line: 703]  
Array index out of bounds: 387 from an array of size 387  
0x00007fff259d2817 UnrealLightmass-Core.dll!UnknownFunction   
0x00007ff7e1c21578 UnrealLightmass.exe!DispatchCheckVerify\<void,\<lambda\_665257cb03ec5816ed3e7b5fb0bd5f90\> \>()   
0x00007ff7e1be6a4a UnrealLightmass.exe!Lightmass::FStaticMeshStaticLightingMesh::GetTriangleIndices()   
0x00007ff7e1b5cb1a UnrealLightmass.exe!Lightmass::FEmbreeGeometry::FEmbreeGeometry()   
0x00007ff7e1b6640b UnrealLightmass.exe!Lightmass::FEmbreeAggregateMesh::AddMesh()   
0x00007ff7e1bb79d5 UnrealLightmass.exe!Lightmass::FStaticLightingSystem::FStaticLightingSystem()   
0x00007ff7e1b6aa69 UnrealLightmass.exe!Lightmass::BuildStaticLighting()   
0x00007ff7e1b917f7 UnrealLightmass.exe!Lightmass::LightmassMain()   
0x00007ff7e1bb09d3 UnrealLightmass.exe!main()   
0x00007ff7e1c193d4 UnrealLightmass.exe!\_\_scrt\_common\_main\_seh()   
0x00007ff81d3b7614 KERNEL32.DLL!UnknownFunction   
0x00007ff81d9e26a1 ntdll.dll!UnknownFunction   
0x00007ff81514c329 CylanceMemDef64.dll!UnknownFunction   
0x00007ff81514f62b CylanceMemDef64.dll!UnknownFunction   
0x00007ff81b22cd29 KERNELBASE.dll!UnknownFunction   
0x00007fff25c9bb06 UnrealLightmass-Core.dll!UnknownFunction   
0x00007fff25c9fa77 UnrealLightmass-Core.dll!UnknownFunction   
0x00007fff25a70ced UnrealLightmass-Core.dll!UnknownFunction   
0x00007fff259d11eb UnrealLightmass-Core.dll!UnknownFunction   
0x00007fff259d2850 UnrealLightmass-Core.dll!UnknownFunction   
0x00007ff7e1c21578 UnrealLightmass.exe!DispatchCheckVerify\<void,\<lambda\_665257cb03ec5816ed3e7b5fb0bd5f90\> \>()   
0x00007ff7e1be6a4a UnrealLightmass.exe!Lightmass::FStaticMeshStaticLightingMesh::GetTriangleIndices()   
0x00007ff7e1b5cb1a UnrealLightmass.exe!Lightmass::FEmbreeGeometry::FEmbreeGeometry()   
0x00007ff7e1b6640b UnrealLightmass.exe!Lightmass::FEmbreeAggregateMesh::AddMesh()   
0x00007ff7e1bb79d5 UnrealLightmass.exe!Lightmass::FStaticLightingSystem::FStaticLightingSystem()   
0x00007ff7e1b6aa69 UnrealLightmass.exe!Lightmass::BuildStaticLighting()   
0x00007ff7e1b917f7 UnrealLightmass.exe!Lightmass::LightmassMain()   
0x00007ff7e1bb09d3 UnrealLightmass.exe!main()   
0x00007ff7e1c193d4 UnrealLightmass.exe!\_\_scrt\_common\_main\_seh()   
0x00007ff81d3b7614 KERNEL32.DLL!UnknownFunction   
0x00007ff81d9e26a1 ntdll.dll!UnknownFunction   
0x00007ff81514c329 CylanceMemDef64.dll!UnknownFunction   
0x00007ff81514f62b CylanceMemDef64.dll!UnknownFunction   
Job has failed! Job executable didn’t exit cleanly. Exit code

I receive the error when I have either of the Cesium3DTileset classes loaded such as World terrain or buildings. I have tried to set a lightmass importance volume but no luck. Any ideas?

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [January 30, 2023, 9:48am UTC](https://community.cesium.com/t/unreal-engine-4-and-5-lightmass-iussues/22130/2 "2023-01-30T09:48:44Z")

</div>

I don’t know what would cause that. Can you provide us with detailed instructions for reproducing the crash in a new project or in the Cesium for Unreal Samples project?

---

<div class="post-metadata">

**Author:** ![karlsson.adam](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/karlsson.adam/32/11887_2.png) [@karlsson.adam](https://community.cesium.com/u/karlsson.adam)\
**Post date:** [January 30, 2023, 10:21am UTC](https://community.cesium.com/t/unreal-engine-4-and-5-lightmass-iussues/22130/3 "2023-01-30T10:21:32Z")

</div>

Thanks for the fast reply! I reproduce this using the following:

1. Start a new Unreal Engine empty game template for c++.
2. Copy the CESIUM plugin to the Plugins folder of the new template.
3. Make sure CESIUM is active (Version 1.21.0)
4. Make a new level and save it in the content folder.  
5.Connect to Cesium and Add a OSM Buildings Node.I directly get a warning of unbuilt lighting.
5. Exporting light data 100% done, then when it is building light data i get Light mass crash error.

LightingResults: Warning: No importance volume found and the scene is so large that the automatically synthesized volume will not yield good results. Please add a tightly bounding lightmass importance volume to optimize your scene’s quality and lighting build times.  
LogStaticLightingSystem: Running Lightmass w/ ImmediateImport mode ENABLED  
LogStaticLightingSystem: Running Lightmass w/ ImmediateProcess mode ENABLED  
LogStaticLightingSystem: Running Lightmass w/ Sorting mode ENABLED  
LogStaticLightingSystem: Running Lightmass w/ Mapping paddings ENABLED  
LogStaticLightingSystem: Running Lightmass w/ Mapping debug paddings DISABLED  
LogUnrealMath: Error: FMatrix::InverseFast(), trying to invert a NIL matrix, this results in NaNs! Use Inverse() instead.  
LogUnrealMath: Error: FMatrix::InverseFast(), trying to invert a NIL matrix, this results in NaNs! Use Inverse() instead.  
LogEditorBuildUtils: Build time 0:05  
LogUnrealMath: Error: FMatrix::InverseFast(), trying to invert a NIL matrix, this results in NaNs! Use Inverse() instead.  
LogUnrealMath: Error: FMatrix::InverseFast(), trying to invert a NIL matrix, this results in NaNs! Use Inverse() instead.  
LogShaderCompilers: Display: === FShaderJobCache stats ===  
LogShaderCompilers: Display: Total job queries 0, among them cache hits 0 (0.00%)  
LogShaderCompilers: Display: Tracking 0 distinct input hashes that result in 0 distinct outputs (0.00%)  
LogShaderCompilers: Display: RAM used: 0.00 MB (0.00 GB) of 1638.40 MB (1.60 GB) budget. Usage: 0.00%  
LogShaderCompilers: Display: ================================================  
LogUObjectHash: Compacting FUObjectHashTables data took 0.63ms  
=== Lightmass crashed: ===  
Assertion failed: (Index \>= 0) & (Index \< ArrayNum) [File:D:\Build++UE4\Sync\Engine\Source\Runtime\Core\Public\Containers/Array.h] [Line: 703]  
Array index out of bounds: 387 from an array of size 387  
0x00007fff34302817 UnrealLightmass-Core.dll!UnknownFunction   
0x00007ff7677f1578 UnrealLightmass.exe!DispatchCheckVerify\<void,\<lambda\_665257cb03ec5816ed3e7b5fb0bd5f90\> \>()   
0x00007ff7677b6a4a UnrealLightmass.exe!Lightmass::FStaticMeshStaticLightingMesh::GetTriangleIndices()   
0x00007ff76772cb1a UnrealLightmass.exe!Lightmass::FEmbreeGeometry::FEmbreeGeometry()   
0x00007ff76773640b UnrealLightmass.exe!Lightmass::FEmbreeAggregateMesh::AddMesh()   
0x00007ff7677879d5 UnrealLightmass.exe!Lightmass::FStaticLightingSystem::FStaticLightingSystem()   
0x00007ff76773aa69 UnrealLightmass.exe!Lightmass::BuildStaticLighting()   
0x00007ff7677617f7 UnrealLightmass.exe!Lightmass::LightmassMain()   
0x00007ff7677809d3 UnrealLightmass.exe!main()   
0x00007ff7677e93d4 UnrealLightmass.exe!\_\_scrt\_common\_main\_seh()   
0x00007ff81d3b7614 KERNEL32.DLL!UnknownFunction   
0x00007ff81d9e26a1 ntdll.dll!UnknownFunction   
0x00007ff81514c329 CylanceMemDef64.dll!UnknownFunction   
0x00007ff81514f62b CylanceMemDef64.dll!UnknownFunction   
0x00007ff81b22cd29 KERNELBASE.dll!UnknownFunction   
0x00007fff345cbb06 UnrealLightmass-Core.dll!UnknownFunction   
0x00007fff345cfa77 UnrealLightmass-Core.dll!UnknownFunction   
0x00007fff343a0ced UnrealLightmass-Core.dll!UnknownFunction   
0x00007fff343011eb UnrealLightmass-Core.dll!UnknownFunction   
0x00007fff34302850 UnrealLightmass-Core.dll!UnknownFunction   
0x00007ff7677f1578 UnrealLightmass.exe!DispatchCheckVerify\<void,\<lambda\_665257cb03ec5816ed3e7b5fb0bd5f90\> \>()   
0x00007ff7677b6a4a UnrealLightmass.exe!Lightmass::FStaticMeshStaticLightingMesh::GetTriangleIndices()   
0x00007ff76772cb1a UnrealLightmass.exe!Lightmass::FEmbreeGeometry::FEmbreeGeometry()   
0x00007ff76773640b UnrealLightmass.exe!Lightmass::FEmbreeAggregateMesh::AddMesh()   
0x00007ff7677879d5 UnrealLightmass.exe!Lightmass::FStaticLightingSystem::FStaticLightingSystem()   
0x00007ff76773aa69 UnrealLightmass.exe!Lightmass::BuildStaticLighting()   
0x00007ff7677617f7 UnrealLightmass.exe!Lightmass::LightmassMain()   
0x00007ff7677809d3 UnrealLightmass.exe!main()   
0x00007ff7677e93d4 UnrealLightmass.exe!\_\_scrt\_common\_main\_seh()   
0x00007ff81d3b7614 KERNEL32.DLL!UnknownFunction   
0x00007ff81d9e26a1 ntdll.dll!UnknownFunction   
0x00007ff81514c329 CylanceMemDef64.dll!UnknownFunction   
0x00007ff81514f62b CylanceMemDef64.dll!UnknownFunction   
\*\*\* CRITICAL ERROR! Machine: CSEGOTLD1231G7R  
\*\*\* CRITICAL ERROR! Logfile: UnrealLight\_CSEGOTLD1231G7R\_1B3BAAD54E80A23BAFFD4FBF202A7F16.log  
\*\*\* CRITICAL ERROR! Crash report:  
LightingResults: Error: === Lightmass crashed: ===  
Assertion failed: (Index \>= 0) & (Index \< ArrayNum) [File:D:\Build++UE4\Sync\Engine\Source\Runtime\Core\Public\Containers/Array.h] [Line: 703]  
Array index out of bounds: 387 from an array of size 387  
0x00007fff34302817 UnrealLightmass-Core.dll!UnknownFunction   
0x00007ff7677f1578 UnrealLightmass.exe!DispatchCheckVerify\<void,\<lambda\_665257cb03ec5816ed3e7b5fb0bd5f90\> \>()   
0x00007ff7677b6a4a UnrealLightmass.exe!Lightmass::FStaticMeshStaticLightingMesh::GetTriangleIndices()   
0x00007ff76772cb1a UnrealLightmass.exe!Lightmass::FEmbreeGeometry::FEmbreeGeometry()   
0x00007ff76773640b UnrealLightmass.exe!Lightmass::FEmbreeAggregateMesh::AddMesh()   
0x00007ff7677879d5 UnrealLightmass.exe!Lightmass::FStaticLightingSystem::FStaticLightingSystem()   
0x00007ff76773aa69 UnrealLightmass.exe!Lightmass::BuildStaticLighting()   
0x00007ff7677617f7 UnrealLightmass.exe!Lightmass::LightmassMain()   
0x00007ff7677809d3 UnrealLightmass.exe!main()   
0x00007ff7677e93d4 UnrealLightmass.exe!\_\_scrt\_common\_main\_seh()   
0x00007ff81d3b7614 KERNEL32.DLL!UnknownFunction   
0x00007ff81d9e26a1 ntdll.dll!UnknownFunction   
0x00007ff81514c329 CylanceMemDef64.dll!UnknownFunction   
0x00007ff81514f62b CylanceMemDef64.dll!UnknownFunction   
0x00007ff81b22cd29 KERNELBASE.dll!UnknownFunction   
0x00007fff345cbb06 UnrealLightmass-Core.dll!UnknownFunction   
0x00007fff345cfa77 UnrealLightmass-Core.dll!UnknownFunction   
0x00007fff343a0ced UnrealLightmass-Core.dll!UnknownFunction   
0x00007fff343011eb UnrealLightmass-Core.dll!UnknownFunction   
0x00007fff34302850 UnrealLightmass-Core.dll!UnknownFunction   
0x00007ff7677f1578 UnrealLightmass.exe!DispatchCheckVerify\<void,\<lambda\_665257cb03ec5816ed3e7b5fb0bd5f90\> \>()   
0x00007ff7677b6a4a UnrealLightmass.exe!Lightmass::FStaticMeshStaticLightingMesh::GetTriangleIndices()   
0x00007ff76772cb1a UnrealLightmass.exe!Lightmass::FEmbreeGeometry::FEmbreeGeometry()   
0x00007ff76773640b UnrealLightmass.exe!Lightmass::FEmbreeAggregateMesh::AddMesh()   
0x00007ff7677879d5 UnrealLightmass.exe!Lightmass::FStaticLightingSystem::FStaticLightingSystem()   
0x00007ff76773aa69 UnrealLightmass.exe!Lightmass::BuildStaticLighting()   
0x00007ff7677617f7 UnrealLightmass.exe!Lightmass::LightmassMain()   
0x00007ff7677809d3 UnrealLightmass.exe!main()   
0x00007ff7677e93d4 UnrealLightmass.exe!\_\_scrt\_common\_main\_seh()   
0x00007ff81d3b7614 KERNEL32.DLL!UnknownFunction   
0x00007ff81d9e26a1 ntdll.dll!UnknownFunction   
0x00007ff81514c329 CylanceMemDef64.dll!UnknownFunction   
0x00007ff81514f62b CylanceMemDef64.dll!UnknownFunction   
Job has failed! Job executable didn’t exit cleanly. Exit code: 1  
LogStaticLightingSystem: Warning: Failed to build lighting!!! Lighting build failed.

---

<div class="post-metadata">

**Author:** ![karlsson.adam](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/karlsson.adam/32/11887_2.png) [@karlsson.adam](https://community.cesium.com/u/karlsson.adam)\
**Post date:** [January 30, 2023, 10:50am UTC](https://community.cesium.com/t/unreal-engine-4-and-5-lightmass-iussues/22130/4 "2023-01-30T10:50:56Z")

</div>

Also, this was reproduced using the Unreal Engine 4.27 which I forgot to mention.

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [January 30, 2023, 11:42am UTC](https://community.cesium.com/t/unreal-engine-4-and-5-lightmass-iussues/22130/5 "2023-01-30T11:42:51Z")

</div>

Thanks @karlsson.adam. Does it also happen if you install Cesium for Unreal as an engine plugin, rather than copying it into your project? I doubt it matters much here, but we usually don’t recommend that people put the built plugin into their project. If you’re putting the plugin in your project, it’s better to include the source in your project and follow the [developer setup instructions](https://github.com/CesiumGS/cesium-unreal/blob/ue4-main/Documentation/developer-setup.md).

---

<div class="post-metadata">

**Author:** ![karlsson.adam](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/karlsson.adam/32/11887_2.png) [@karlsson.adam](https://community.cesium.com/u/karlsson.adam)\
**Post date:** [January 30, 2023, 12:32pm UTC](https://community.cesium.com/t/unreal-engine-4-and-5-lightmass-iussues/22130/6 "2023-01-30T12:32:56Z")

</div>

Hey,

I reproduced the exact same setup, however I have the plug-in installed in the engine rather than in the plug-ins folder now. The same error though. Any ideas?

---

<div class="post-metadata">

**Author:** ![karlsson.adam](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/karlsson.adam/32/11887_2.png) [@karlsson.adam](https://community.cesium.com/u/karlsson.adam)\
**Post date:** [January 30, 2023, 12:47pm UTC](https://community.cesium.com/t/unreal-engine-4-and-5-lightmass-iussues/22130/7 "2023-01-30T12:47:09Z")

</div>

Not sure if it helps but I did the same procedure for the sample project from the Epic Games Store/Launcher. I still receive the error.

---

<div class="post-metadata">

**Author:** ![terzogenito](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/terzogenito/32/7149_2.png) [@terzogenito](https://community.cesium.com/u/terzogenito)\
**Post date:** [January 31, 2023, 1:59pm UTC](https://community.cesium.com/t/unreal-engine-4-and-5-lightmass-iussues/22130/8 "2023-01-31T13:59:14Z")

</div>

I don’t get crash after enable ‘Force No Precomputed Lighting’ in the world settings of level.

---

<div class="post-metadata">

**Author:** ![karlsson.adam](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/karlsson.adam/32/11887_2.png) [@karlsson.adam](https://community.cesium.com/u/karlsson.adam)\
**Post date:** [February 1, 2023, 10:06am UTC](https://community.cesium.com/t/unreal-engine-4-and-5-lightmass-iussues/22130/9 "2023-02-01T10:06:20Z")

</div>

Okay thanks, in that case static lighting is off and I guess that is how it is supposed to be? 🙂
