- Modified Nanite::IBuilderModule::FInputMeshData to take FBounds3f instead of FBoxSphereBounds since NaniteBuilder doesn't require sphere bounds.
- Calculate VertexBounds in DisplaceNaniteMesh(...) and BuildMeshDataFromGeometryCollection(...)
#rb rune.stubbe
#preflight 64258edb973e609670eb2ef0
#lockdown marc.audy
[CL 24884479 by marc audy in ue5-main branch]
The initialization code for PercentTriangles was lost in 24853395, seemingly by mistake.
[REVIEW] [at]tiago.costa
[CL 24867875 by rune stubbe in ue5-main branch]
* Added a FBoxSphereBounds::Builder class to help avoid these kind of issues
#rb jeanfrancois.dube, patrick.enfedaque
[FYI] Graham.Wihlidal
#preflight 6419e677ec01de1664d3e95c
[CL 24739078 by sebastien lussier in ue5-main branch]
Highlights:
* Only allocate and use a wedge map for non-Nanite LODs, or if the mesh is sub 300kindices and it will be cache optimized
* Only allocate and use a remap if there are no overlapping corners
* When the Nanite landscape mesh is created, we now ensure the mesh description is fully compacted, computed, and optimized prior to committing it, along with making sure there are no overlapping corners.
* Since Nanite landscape is checked to ensure no overlapping corners before the build, we can also now skip computing the overlapping corners, which was an intense number of tiny allocations.
* When Nanite landscape is being built as a static mesh, we now avoid super expensive temporary copies of the mesh description, knowing that no actual mutation will occur.
* The original code (after building) would release the memory from the mesh description copy, but it would not release the original immutable cached copy from memory (now that is released too)
* Fixed NaniteLODIndex incorrectly creating a mesh description at a LOD other than the expected 0
* Removed a full loop over all vertex positions by calculating the bounding box while we're building the vertex buffer (and already processing every vertex)
* Added a NeedsCompact() helper to MeshDescription to avoid expensive and unnecessary Compact() calls that do lots of reallocs/copies even if the mesh description is already contiguous\packed in memory.
* Skip building distance field and mesh card representations for the Nanite landscape mesh, which also avoids more cached mesh description deserialization and copies into memory.
Note: In the near future the APIs around this wil be cleaned up further.
#rb richard.talbotwatkin, yuriy.odonnell
[FYI] zousar.shaker, brian.karis, rune.stubbe, juan.canada, danny.couture
#preflight 640b7390482188d710464d39
[CL 24601442 by graham wihlidal in ue5-main branch]
This is an enum to say which target to reduce to for the fallback. It makes the default "Auto" which gives us more ability to change the default heuristic without needing to change uproperty defaults.
Along with this added r.Nanite.Builder.FallbackTriangleThreshold. Any mesh with source triangle count less than this threshold uses the source triangles directly for the fallback.
#rb graham.wihlidal
#lockdown marc.audy
#preflight 63f0041b1d71bcd26225228c
[CL 24330590 by brian karis in ue5-main branch]