Hii,
we render through our own MRQ based pipeline in uncooked -game (UnrealEditor.exe <project> -game), so a packaged build is not an option for us. Since 5.6/5.7 Nanite landscapes don’t render as Nanite there anymore. In the editor everything is fine (Nanite + displacement), in -game the landscape is black in r.Nanite.Visualize Triangles and there is no displacement. Nanite static meshes render fine.
Expected: Nanite in -game, same as editor / PIE / cooked.
Actual: Nanite components get removed on load, non-Nanite path.
What we found
It looks like the landscape texture hash (ULandscapeTextureHash) is editor-only and is not loaded in uncooked -game. Because of that the Nanite content ID is calculated differently than in the editor, ALandscapeProxy::PostLoad treats the Nanite data as out of date and removes the Nanite components. That would also explain why the “out of date” warning only shows up in -game. PIE and cooked builds are not affected. I can share more details (code locations, callstacks) if that helps.
PIE works because GIsEditor is true, cooked works because the WITH_EDITOR checks are compiled out and the cook rebuilds Nanite.
Second issue
As a workaround we tried to rebuild the Nanite data at runtime in -game (ALandscapeProxy::UpdateNaniteRepresentation). The build works, but afterwards the landscape is completely gone. The new Nanite components are created as Static, and once the game is running a Static component doesn’t accept a new mesh (“Calling SetStaticMesh … but Mobility is Static” in the log). The landscape still switches to Nanite, but the Nanite components are empty. Probably not an intended use case, just mentioning it.
Our workaround
A small project plugin rebuilds the Nanite data after a level is loaded in -game. Before the meshes get assigned it sets the new Nanite components to Movable and switches them back to Static afterwards. This works, but adds a few seconds to every level load, so we would prefer a proper fix.
Questions
- Is this a known issue, and is a fix planned?
- Is there a supported way to get Nanite landscapes in uncooked -game that I’m missing?
Thanks
[Attachment Removed]