FarField only works in WorldPartitionRuntimeHashSet if HLOD Layer asset is not spatially loaded

We are seeing an issue trying to get Far Field support with a spatially loaded HLOD layer. Referring to this question:

[Content removed]

We were of the assumption that only the grid settings in World Settings HLOD setup mattered (except needing to still use the asset to set HLOD parent hierarchy). However, we have noticed that Far Field does not work if “Is Spatially Loaded” is checked in the HLOD Layer asset. If we uncheck “Is Spatially Loaded” in the HLOD Layer asset and rebuild HLODs, the meshes reappear in Far Field, but the HLODs are now always loaded. It appears the “Is Spatially Loaded” checkbox in World Settings HLOD is only respected if the “Is Spatially Loaded” in the HLOD asset is also checked.

It seems if you want a spatially loaded HLOD, you have to have “Is Spatially Loaded” checked in both the HLOD Layer asset and in World Settings, but only the cell size and loading range are read from World Settings HLOD?

And since Far Field only seems to work when “Is Spatially Loaded” is unchecked in the HLOD asset, which causes the HLODs to be always loaded regardless of the “Is Spatially Loaded” value in World Settings, there doesn’t seem to be a way to have Far Field work with a spatially loaded HLOD. Is this a bug or by design?

Thank you.

Steps to Reproduce

  1. Create a Merged HLOD Layer asset with Is Spatially Loaded Unchecked
  2. In a World Partition level using WorldPartitionRuntimeHashSet, set Cell Size 12800, Loading Range 25600.
  3. Add the HLODLayer to an HLODSetup with Is Spatially Loaded Check, Cell Size 12800, Loading Range 76800, and set the HLOD asset as the Default HLOD Layer
  4. Place some large meshes in the HLOD range and Build HLODs
  5. Use debug view Ray Tracing Debug > Far Field and see the meshes in the view. But the HLODs are always loaded and wp.Runtime.ToggleDrawRuntimeHash2D only shows the main grid.
  6. In the HLOD Layer asset, enable Spatially Loaded Unchecked and rebuild HLODs
  7. Use debug view Ray Tracing Debug > Far Field and see the meshes no longer in the view. The HLODs are now spatially loaded and wp.Runtime.ToggleDrawRuntimeHash2D shows the main grid and the HLOD grid

Hi Chad!

First, sorry for the confusion about the grid settings showing up in the HLOD layer asset. That was a requirement when working with the older Runtime Spatial Hash, but since the introduction of the Runtime Hash Set, these HLOD layer settings should not be used.

I’ve actually completed a UX cleanup which will go live in 5.7. Hopefully this will clear things up a bit!

Now, to your core issue of having non-spatially loaded HLODs in the FarField. This is actually “by-design” for now as it’s the way we had things configured when we developed The Matrix demo (CitySample).

See line ~862 in Engine\Plugins\Editor\WorldPartitionHLODUtilities\Source\Private\WorldPartition\HLOD\Utilities\WorldPartitionHLODUtilities.cpp, in FWorldPartitionHLODUtilities::BuildHLOD(…)

// Set up ray tracing far fields for always loaded HLODs if (!InHLODActor->GetIsSpatiallyLoaded() && StaticMesh->bSupportRayTracing) { StaticMeshComponent->bRayTracingFarField = true; }That should probably be an option I guess… In the meantime, you can change those lines if you want a different behavior!

Regards,

Sebastien