* Required for future changes to improve the mesh merging capability to cope with missing/invalid UVs when trying to perform material baking.
#rb ryan.schmidt
[CL 26014245 by sebastien lussier in ue5-main branch]
Add ECoarseApproximationStrategy to IGeometryProcessing_CombineMeshInstances, and FOptions.CoarseLODStrategy, as well as .CoarseApproximationDetailSize (previously was hardcoded to 10 in impelmentation). Rename 'Voxel' to 'Coarse' in the Options struct.
Improve ComputeSweptSolidApproximation in CombineMeshInstancesImpl - 'Square' offset was a chamfer, but generally we want a Miter, with Miter cut threshold set to diagonal length.
Add ComputeBestFullProjectionMesh in CombineMeshInstancesImpl, computes swept-solid approximation along all 3 axes and selects the one w/ lowest geometric deviation
BuildCombinedMesh now supports using SweptPlanarProjection instead of Voxel approximation, or trying both and selecting the one w/ lower geometric deviation.
Disabled coplanar merging and planar retriangulation when doing hidden removal of voxel LODs (was unintentionally doing this)
Update internal usage
#rb none
#preflight 64791efee319748a836e1be5
[CL 25762477 by ryan schmidt in ue5-main branch]
Also tweaked geometric tolerances recently added to RemoveHiddenFaces_ExteriorVisibilit() as they seem to be too aggressive (need to add real-world dimensions here).
Updated internal usage to enable this new capability
#rb none
#preflight 646cea301417daba1e6120a7
#rnx
[CL 25592274 by ryan schmidt in ue5-main branch]
Renamed FInstanceSet to FSourceInstanceList in CombineMeshInstances API
Added FMeshInstanceGroupData.bPreserveUVs flag, defaults to false, in which case UVs are discarded on simplified and approximate meshes to encourage simplification
Added FOptions::MaxAllowableApproximationDeviation, prevents very large deviation in approximation of highly non-convex parts (may break some approximations, might need per-part overrides in future)
Added FOptions::bDoubleSidedHiddenRemoval, treating as single-sided improves hidden removal
FOptions::ApproximationSourceLOD can now be set to a generated simplified LOD, in addition to Source LODs. This helps avoid approximations being higher-quality than simplified parts
In CombineMeshInstancesImpl, renamed FMeshInstanceSet to FMeshPart, FMeshInstance to FMeshPartInstance, FMeshInstanceAssembly to FMeshPartsAssembly, to help clarify internal vs external data structures (many renaming changes as a result)
FPartApproxSelector now has MaxAllowableDeviation, set from new FOptions member, prevents major shape deviation (maybe too strict? might be good to count how many things deviate...)
tweaked AABB-override of approximations based on volume comparison
reduced InitialTriCost scaling for extra approximate LODs in ComputeMeshApproximations - this value is used as an exponent and so if it gets larger than ~5, for large deviations it will basically be infinity and stops being useful. This may need more work as it tends to go to box approximation very quickly now.
Various improvements to RemoveHiddenFaces_ExteriorVisibility. Now can backface-cull, does so by FOptions default. Improved filtering around "glancing angle" rays/hits. Changed from using fixed exterior point set as visibility locations, to direction set. Add slight downscaling of UV triangles, and of hit-triangle barycentric coords, to filter out hits very near to triangle edges, which can often be spurious.
updated internal usage for renaming, set plausible MaxAllowableApproximationDeviation, and using simplified LODs as ApproximationSourceLOD
#rb none
#preflight
[CL 25546006 by ryan schmidt in ue5-main branch]
Add explicit support for Axis-Aligned Box Approximation in addition to existing Oriented Box. Add explicit preference for AABB if it's volume is within 20% of OBB or best-shape approximation.
Other minor fixes.
#rb none
#preflight 64654aedd62884a78f5cbfa9
[CL 25519890 by ryan schmidt in ue5-main branch]
Also added FOptions::VertexColorMappingMode which currently only supports a mapping from tri count (relative to a box) to a white-to-red vertex color scale, basically intended for use as a debug visualization.
#rb none
#preflight 645c13e38e01daf0e5c115f0
#rnx
[CL 25420851 by ryan schmidt in ue5-main branch]
GeometryCore: Make TAxisAlignedBox3::DistanceSquared const (should have been). Add TQuaternion * scalar and operator+ functions. Add TTransformSRT3::GetScale3D for API compatibility with engine FTransform
Add FSimpleShapeSet3d::Append() variant that takes a FTransformSequence3d
#rb rinat.abdrashitov
#preflight 63fe7971437ce3e7f3b51c8a
[CL 24454963 by ryan schmidt in ue5-main branch]
ApproximateActors: add FMeshApproximationSettings::bEnableSimplifyPrePass option, default true, and implement in ApproximateActors impl. This does a fast-collapse down to a multiple of the target triangle count (or 1m tris in tolerance-mode). This reduces simplification time in HLOD builds for small city from 4-5m to 1m in some of the worst blocks.
ApproximateActors: add FMeshApproximationSettings::bEnableParallelBaking, default true, and implement in the ApproximateActors Impl. This allows the photocapture step to proceed at the same time as the mesh generation, which shaves 30-40s off every HLOD build, but increases memory requirements.
#rb sebastien.lussier
#jira UE-142582
#preflight 6214fd9e797dbbeb4723468e
#rnx
#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 19083146 in //UE5/Release-5.0/... via CL 19097574
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)
[CL 19141130 by ryan schmidt in ue5-main branch]
- add FStaticMeshLODResourcesAdapter in MeshConversions module, wrapper that presents StaticMesh LODResources mesh (ie Section buffers) with an API compatible with GeometryCore mesh templates
- add TMeshWrapperAdapterd in GeometryCore, this is a shim for getting any template-API-compatible mesh into a FTriangleMeshAdapterd specifically (required to call some non-template mesh processing functions)
- add support for using StaticMesh LODResources meshes in FMeshSceneAdapter instead of source meshes, controlled by build options flag
- add FMeshSceneAdapter build options flags specifying whether UV/Normal queries are required (default true)
- when not required, the loaded MeshDescriptions and created DynamicMeshes are packed into FColliderMesh which has a smaller memory footprint, allowing the larger meshes to be freed
- to support above, the SpatialWrappers in MeshSceneAdapter.cpp have been refactored extensively
- added FCompressedMeshSpatialWrapper which Builds from a temporary FDynamicMesh3 into a FColliderMesh, supports all the same options as FDynamicMeshSpatialWrapper (so a drop-in replacement with less memory usage, but no UV/Normal queries)
- added FBaseMeshSpatialWrapper, base class for existing FDynamicMeshSpatialWrapper and new FCompressedMeshSpatialWrapper that has shared config settings (can more more here in the future)
- added FStaticMeshLODResourcesMeshSurfaceAdapter, similar toFMeshDescriptionTriangleMeshSurfaceAdapter, a mesh adapter that filters out any geo that doesn't have a Surface-domain material
- refactored TStaticMeshSpatialWrapper into TStaticMeshSpatialWrapperBase and subclasses FStaticMeshSourceDataSpatialWrapper and FStaticMeshRenderDataSpatialWrapper, for source mesh vs render mesh
- added FCompressedStaticMeshSpatialWrapper, variant of FStaticMeshSourceDataSpatialWrapper that stores to a FColliderMesh and releases the source MeshDescription
- SpatialWrapperFactory() now has logic to build from render mesh vs source mesh vs compressed source mesh
- moved initial SpatialWrapper construction from AddActors() phase to Build() phase, because now it depends on build settings
- add EMeshDataSourceLODPolicy to IGeometryProcessing::FOptions, with LOD0 Source and LOD0 RenderMesh options
- ApproximateActorsImpl now provides/handles this policy setting, and configures FMeshSceneAdapter to not need UV/Normal queries (not required in this context)
- add bUseRenderLODMeshes option in FMeshApproximationSettings to expose render vs source mesh control at user level
#rb sebastien.lussier, rinat.abdrashitov
#jira UE-141256
#preflight 6206db44054c2e38c473be5d
#rnx
#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 18963126 in //UE5/Release-5.0/... via CL 18963829 via CL 18964587
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)
[CL 18964607 by ryan schmidt in ue5-main branch]