4.17 Lighting Build Fails

Hi,

We upgraded our project from 4.16 to 4.17, and now lighting build always fails on one of our maps.

Using the LIGHTMASSDEBUG console command, executing UnrealLightMass.exe under debugger, I found an array overrun access occurred.

Engine\Source\Programs\UnrealLightmass\Private\Lighting\Embree.cpp: FEmbreeGeometry::FEmbreeGeometry()

 UVs[I1] = V1.TextureCoordinates[Mesh->TextureCoordinateIndex];

num of UVs is 0x00003588, but I1 = 0x00003588. This is overrun.

And I found a suspected mismatch in related variables (by Visual Studio Watch window notation):

  • this->Mesh->NumVertices = 0x00003588
  • ((Lightmass::FStaticMeshLOD*)((Lightmass::FStaticMeshStaticLightingMesh*)(this->Mesh))->StaticMesh->LODs.AllocatorInstance.Data)[0].Vertices = 0x000035a2

I suppose these values should be equal.

I tried to Build LODs/Build Geometry, but it does not resolve this situation. Lighting Quality does not affect this either.

Hi,

We encountered the same issue in 4.16. It looks like the culprit is that UStaticMesh::PostDuplicate forget to regenerate LightingGuid when static meshes are duplicated in the content browser.

If you place two or more duplicated static meshes in the same level, lightmass failed to identify the correct static mesh. And if static mesh’s lod settings are different (e.g. Percent Triangles), vertex count mismatch could happen.

Thanks for the report. I’ve entered this as UE-49064.