Hello,
We found that Nanite fallback meshes use around 100MB of VRAM in some of our scenes. We have the fallback meshes relatively low-poly, but there are just too many unique ones.
`FStaticMeshRenderData::InitResources` seems to initialize `LODResources` and `LODVertexFactories` for any mesh, even if Nanite data is valid.
I modified this function to skip the loop through `LODResources`
static const auto EnableNaniteCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Nanite")); if (!HasValidNaniteData() || !DoesPlatformSupportNanite(GMaxRHIShaderPlatform) || !EnableNaniteCVar || EnableNaniteCVar->GetInt() == 0) { for (int32 LODIndex = 0; LODIndex < LODResources.Num(); ++LODIndex) ....
And it worked well, until it crashed in `FSceneProxy::FFallbackLODInfo::FFallbackLODInfo` on `checkf(LocalVF->GetTangentsSRV()…` because Nanite StaticMeshes were used by some StaticMeshComponents with OverrideVertexColors. We’ve fixed that issue by removing the MeshPainting from those components.
However, we are now very concerned about the stability and general viability of this approach. Do you have any hidden issues or drawbacks in mind?
We only use the software Lumen, so the global `IsRayTracingAllowed()` returns false. In this case, Lumen should not use the fallback mesh at cooked-packaged runtime, correct? Is the SDF generated from the fallback mesh during the cooking process?
Where else does the engine use the fallback mesh?
Thank you.
Best,
Denis