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]
MeshSceneAdapter: handle mis-configured MeshDescription material slot names that reference ImportedMaterialSlotName instead of MaterialSlotName, and fall back to material 0 / default surfarce material in cases where material is not defined (which is normal engine behavior elsewhere). Add CVar to control multi-threading, to support debugging. Fix handling of nearly-thick-enough objects that were incorrectly being converted to very thin shells.
ApproximateActors: Expose options for ground plane clipping, UV generation method, tiny parts filtering, implement support for these options. Add optional base-plane occluder to allow occlusion filtering to remove "bottom" geometry. Implement fallback to Boxmap UVs if UV generation fails. Set default output material on generated Collision meshes.
Expose above options in FMeshApproximationSettings for MergeActors/etc UI
#rb none
#rnx
#preflight 60f9e207a6959a0001bfd867
[FYI] Sebastien.Lussier
#ROBOMERGE-SOURCE: CL 16932394 via CL 16932403
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v838-16927207)
[CL 16932405 by ryan schmidt in ue5-release-engine-test branch]
Supports either:
* From texel density
* From expected mesh screen size
* From expected mesh draw distance
Compute best texture size, taking UV map waste into account.
Currently only supported by the Approximate Actors merge method, to be integrated in the ProxyLOD later.
#rb ryan.schmidt, luc.eygasier
#ROBOMERGE-SOURCE: CL 16635038 via CL 16635077
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v831-16623017)
[CL 16635084 by sebastien lussier in ue5-release-engine-test branch]
Use LogApproximateActors instead of LogTemp
#rb ryan.schmidt
#ROBOMERGE-SOURCE: CL 16559789
#ROBOMERGE-BOT: (v828-16531559)
[CL 16559817 by sebastien lussier in ue5-main branch]
* Moved duplicated code that was constructing a IGeometryProcessing_ApproximateActors::FOptions from a FMeshApproximationSettings to FApproximateActorsImpl::ConstructOptions()
* Added mesh generation options
** bAllowDistanceField - on by default
** bSupportRayTracing - on by default
** bGenerateLightmapUVs - off by default
* Disable creation of physics body for HLOD
* Scale texture size based on grid promotion (higher z grid index -> higher area covered) - Only temporary, will probably switch to a texel density option instead
#rb ryan.schmidt, jeanfrancois.dube, luc.eygasier
#ROBOMERGE-SOURCE: CL 16538607 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v828-16531559)
[CL 16538620 by sebastien lussier in ue5-main branch]
- extend FImageAdapter to support reading
ModelingComponents::
- Add AssetUtils::ForceVirtualTexturePrefetch(), ::SaveDebugImage() variants to Texture2DUtil
- Add support for debug image writing to WorldRenderCapture and SceneCapturePhotoSet
- FWorldRenderCapture now computes more accurate bounds (visible Components instead of Actors), and does an explicit VirtualTexture prefetch before doing render capture
- FStaticMeshAssetOptions now exposes Nanite settings to allow UStaticMeshes to be created with Nanite already enabled (currently NaniteSettings.PositionPrecision defaults to max)
ApproximateActors:
- IGeometryProcessing_ApproximateActors::FOptions now has settings for enabling Nanite on generated meshes
- ApproximateActorsImpl applies these settings, also enables VT on generated textures if necessary
- FMeshApproximationSettings/FMeshApproximationTool updated w/ new Nanite settings
#rb none
#rnx
#jira none
[FYI] sebastien.lussier
#preflight 60b08323f51cd90001775b98
#ROBOMERGE-OWNER: ryan.schmidt
#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 16499613 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v823-16466674)
#ROBOMERGE-CONFLICT from-shelf
[CL 16499647 by ryan schmidt in ue5-main branch]
- FMeshSceneAdapter updates
- if bThickenThinMeshes is enabled, then all instance meshes are converted to DynamicMesh and decomposed to find non-closed regions. Those regions are uniqued into separate meshes. The remaining closed geometry is separated out and kept as instanced.
- various utility functions added to support above
- previous code to explicitly 'thicken' open meshes into solids is removed. Instead unsigned distance is used to determine inside/outside and generate a 1/0 winding number
- instances are now sorted into an octree to speed up winding number evaluations
- If all meshes are closed (or effectively closed via above, ie will return integer winding number) then winding number query can early-out as soon as it finds a non-zero value
- Add hard-normals options in IGeometryProcessing_ApproximateActors (not exposed in MergeActors tool options yet)
- Added hard-normal callucation to ApproximateActorsImpl, and additional profiling
- Allow specification of actual ECollisionTraceFlag options in CreateStaticMeshUtil, instead of just a boolean
- Add FSparseDynamicOctree3::ContainmentQueryCancellable() variant that can early-exit
#rb none
#rnx
#jira none
#preflight 60a686274c320300018d3841
#ROBOMERGE-SOURCE: CL 16410125 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v804-16311228)
[CL 16412542 by ryan schmidt in ue5-main branch]
- Add FImageAdapter, wraps TImageBuilder of different types and provides a consistent interface, so that other code doesn't need specializations for each image type
- FMeshSceneAdapter now supports the ability to detect and thicken "thin" meshes, by flattening the instances into unique mesh copies (generally necessary due to scaling). Can also now return statistics about the mesh scene, return a full flattened mesh (for debugging), and automatically generate a "closing mesh" that can help to cap off the base of mesh assemblies when trying to generate a solid/etc.
ModelingComponents:
- FWorldRenderCapture now writes via FImageAdapter instead of an Image4f
- FSceneCapturePhotoSet now stores less data for photo sets. BaseColor/Emissive/WorldNormal are 3f, Roughness/Specular/Metallic are 1f
- IApproximateActors and implementation now support optional base-capping, occluded mesh removal, geometric-tolerance simplification, thin mesh auth-thickening. Now creates MICs based on an input Material, instead of new Material. Added ability to emit a flattened debug mesh, and print debug info.
MergeActors:
- Expose above improvements to IApproximateActors
#rb none
#rnx
#jira none
#preflight 609ef005f6c6e3000144c5e2
[CL 16338550 by Ryan Schmidt in ue5-main branch]
Add GeometryProcessingAdapters module to MeshModelingToolset, this is an Editor-only module that implements GeometryProcessingInterfaces APIs
Add ApproximateActors implementation in GeometryProcessingAdapters that uses GeometryProcessing (FastWindingNumber / MeshMorphology / Simplify / UVGen / Tangents) and a new material-baking process based on render captures to generate a new StaticMesh Asset / Material / Textures that approximate the input Actor set.
#rb none
#rnx
#jira none
#preflight 608b25ced4026b0001cbe9c4
[CL 16162961 by Ryan Schmidt in ue5-main branch]