Building HLOD from Landscape Streaming Proxies result in NaNs found on Bounds for Primitive

We are hitting an issue where HLOD building in a level fails with the “NaNs found on Bounds for Primitive” error.

From what I can see, a generated HLOD actor is generated from 4 LandscapeStreamingProxy actors. I can see the actors just fine in editor, they are just flat planes. When ULandscapeHLODBuilder::Build calls UStaticMesh::BatchBuild and then into UStaticMesh::BeginBuildInternal, I can see the call to

<br>

CachedMeshDescriptionBounds = GetSourceModel(0).GetCachedMeshDescription()->GetBounds();

returns a CachedMeshDescriptionBounds with NaN values.

Enable Edit Layers is checked

The Landscape actor itself has the following settings:

Component Resolution 64x64

Component Count 0

Component Subsections 1x1

Resolution 1x1

Landscape Proxy Count 2281

Total Component Count 4650

Overall Resolution 4033x5356

Any ideas what could cause this?

Hello,

I haven’t seen this reported before and was unable to repro. Could you share a stripped-out vanilla project with the issue isolated or the settings that you are using:

  • Are you using nanite landscape?
  • What Landscape HLOD settings are you using?
  • Are there any other warnings or errors from the HLOD builder log?

Thanks,

Ryan

I’m not sure if there is a way to copy landscape from one map to another in another project. But our engineer found:

There’s a skirt value that gets set that is INF, skirt size goes to INF because of a divide by zero error. In LandscapeHLODBuilder.cpp:400 there’s a ScaleFactor computed that has ComponentSizeVerts - 1, which is zero. This is because the component resolution isn’t enough for the number of LODs. If you change the LOD of the landscape used to generate the HLOD to anything lower than 6 (which is what the auto selection picks), then this will work.

Setting the landscape to use lod 4 for HLOD instead of Auto fixed the crash. But I’m curious why the LOD it chooses in Auto would be a degenerate case.

I’m sorry. I meant to update you last week. I was able to repro the issue from your last description and have submitted a fix to address it: cl 41832676 (UE5-Main).

It’s a simple change to the ELandscapeHLODMeshSourceLODPolicy::AutomaticLOD case of ComputeRequiredLandscapeLOD (LandscapeHLODBuilder.cpp):

// Find the matching LOD for the screen size. No need to test the last LOD screen size if we get to it. for (RequiredLOD = 0; RequiredLOD < LODScreenSizes.Num() - 1; ++RequiredLOD) { if (ExpectedScreenSize > LODScreenSizes[RequiredLOD]) { break; } }

-Ryan