* A more efficient version of AppendMeshDescription() for multiple meshes
* Properly reserve arrays to limit amount of temporary allocations
* Add triangles rather than polygons, avoid the costlier SourceMesh.GetPolygonVertexInstances() which had to perform a map lookup
#rb patrick.enfedaque
#robomerge Release-5.0-EarlyAccess
[CL 15419836 by Sebastien Lussier in ue5-main branch]
Common mistakes:
a) TRACE_CPUPROFILER_EVENT_SCOPE("Foo") or TRACE_CPUPROFILER_EVENT_SCOPE("FClass::Foo")
--> results in a timer named "Foo" or "FClass::Foo" (the quotes will be included in the name)
b) TRACE_CPUPROFILER_EVENT_SCOPE(TEXT("Foo"))
--> results in a timer named L"Foo" (L and quotes will be included in the name)
c) TRACE_CPUPROFILER_EVENT_SCOPE_TEXT(TEXT("Other Foo")) or TRACE_CPUPROFILER_EVENT_SCOPE_TEXT("Foo")
--> Slow! It will use dynamic string matching that adds an unnecessary overhead.
Correct usage:
TRACE_CPUPROFILER_EVENT_SCOPE(Foo)
TRACE_CPUPROFILER_EVENT_SCOPE(FClass::Foo)
TRACE_CPUPROFILER_EVENT_SCOPE_STR("Other Foo") // when timer name has spaces
TRACE_CPUPROFILER_EVENT_SCOPE_TEXT(*Foo.ToString()) // only if a dynamic name is really needed
#rb Catalin.Dragoiu
#fyi Marc.Audy, Krzysztof.Narkowicz, Rune.Stubbe, Michal.Valient
[CL 15134822 by ionut matasaru in ue5-main branch]
Removed attribute views.
Refactored MeshAttributeArray implementation.
Added a new GetArrayView() method for all types of TMeshAttributeRefs which can be used generically.
#rb Alexis.Matte
[CL 14651594 by Richard TalbotWatkin in ue5-main branch]
Prepared direct attribute access for deprecation, preferring use of APIs to access static mesh attributes.
Fixed recently merged Enterprise code to comply with new APIs.
Changed all tools to use triangle-centric iteration where possible.
Added new MeshAttributeArray APIs for querying attribute flags, and added a new Mandatory flag.
Various bug fixes.
#rb Alexis.Matte
[CL 13873755 by Richard TalbotWatkin in ue5-main branch]
- Removed hardcoded element type arrays (Vertices, Edges, Triangles etc.). Mesh element types can now be arbitrarily added, with any number of channels.
- Mesh element containers have a much leaner format; instead of sparse arrays, they are now represented by a simple bitarray, determining whether an index is used or not. Consequently, mesh topology is now entirely described with the attribute system, e.g. edge start and end vertices, triangle vertices, etc.
- Support added for attributes of arbitrary dimensions, e.g. float[4] or int[2].
- Support added for attributes which index into another mesh element container.
- Added FMeshElementIndexer: this is an efficient container for maintaining backward references from one element type to another; for example, edges have an attribute specifying which vertices are at each end (an attribute of type FVertexID[2]). With an indexer, it is possible to look up which edges contain a given vertex, even though this is not explicitly stored. Indexers are designed to do minimal allocations and update lazily and in batch when necessary.
- Added support for preserving UV topology in static meshes. UVs are now a first-class element type which may be indexed directly from triangles.
- Added the facility to access the underlying array in an attribute array directly.
- Triangles now directly reference their vertex, edge and UV IDs. Vertex instances are to be deprecated.
- Changed various systems to be triangle-centric rather than polygon-centric, as this is faster. Triangles are presumed to be the elementary face type in a MeshDescription, even if polygons are still supported. The concept of polygons will be somewhat shifted to mean a group of triangles which should be treated collectively for editing purposes.
- Optimised normal/tangent generation and FBX import.
- Deprecated EditableMesh, MeshEditor and StaticMeshEditorExtension plugins - these are to be removed, but they still have certain hooks in place which need removing.
#rb
[CL 13568702 by Richard TalbotWatkin in ue5-main branch]
* Vertex color was not taken into account
* OnCreatedMergedRawMeshes() extensions could wiping out vertices colors (was the case for Fortnite)
** Only call extension for the final merged mesh result
Force an update of all HLODs by changing the proxy key
#rb patrick.enfedaque
#ROBOMERGE-OWNER: sebastien.lussier
#ROBOMERGE-AUTHOR: sebastien.lussier
#ROBOMERGE-SOURCE: CL 12671370 via CL 12671428 via CL 12671436 via CL 12671437
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v675-12543919)
[CL 12672166 by sebastien lussier in Main branch]
* HLOD0 (merged) - Reliance on DoesUVChannelContainData() & the FMeshMergeSettings::OutputUVs[] array was lost during what looks like a bad code merge in ~2018
* HLOD1 (simplified) - Removed strange processing that added a second UV set, supposedly for lightmapping. This isn't needed as it's handled in the static mesh build.
Bumped the HLOD proxy key to force a rebuild of all HLODs
#rb chris.bunner, jeanfrancois.dube
#ROBOMERGE-OWNER: sebastien.lussier
#ROBOMERGE-AUTHOR: sebastien.lussier
#ROBOMERGE-SOURCE: CL 11958420 via CL 11958431 via CL 11958469 via CL 11958487
#ROBOMERGE-BOT: (v656-11643781)
[CL 11961121 by sebastien lussier in Main branch]
Recompile MikkTSpace to include debug symbols in release so we can see callstacks
- Negligible performance impact (<0.2% of total scene import time) when importing a mesh heavy scene (DATASET-0008a)
#jira UE-88333
#rb Jean-Michel.Dignard
#ROBOMERGE-SOURCE: CL 11535830 in //UE4/Release-4.25/...
#ROBOMERGE-BOT: RELEASE (Release-4.25 -> Release-4.25Plus) (v654-11333218)
[CL 11535833 by danny couture in 4.25-Plus branch]
CL 10373564 by danny.couture
Optimize Material Baking (Phase 1)
- Introduce a mecanism to override the vertex/index buffer allocator used for dynamic meshes
- Avoid GDynamicMesh non-ticked pools build-up by using our own vertex/index buffer pool during baking
- Reduce reallocation and incurred soft page faults by reusing a single set of vertex/index buffers big enough for the biggest mesh
- Preemptively detect if smearing would result in monochrome texture to avoid useless work
- Shrink smeared monochrome textures during the baking process for huge memory savings
- Move UV smearing in worker threads to avoid blocking the game thread
- Required shaders are now built asynchronously
- Add progress bar for material baking
- 28m23 [at] 150 GB RAM -> 2m14s [at] 45 GB RAM for 6 channels [at] 512x512 when baking materials on ProxyLOD for DATASET-0008a with DDC empty
#rb Jurre.deBaare, Sebastien.Lussier
CL 10516258 by danny.couture
Optimize Material Baking (Phase 2)
- Implement pipelining with staging buffers to avoid GPU stalls when reading from render targets
- Reuse the same prepared FMeshBatch instead of rebuilding it for each draw pass
- Prepare the RenderItem in advance on other threads to reduce work on the game thread
- Move the staging surface copy out of the render thread
- Small vertex and index buffers are not reused to avoid dependency locks when mapping them
- Fix bug in Canvas Flush_RenderThread found while running HLOD rebuild commandlet on Fortnite
- Delete old and unused MaterialBakingModule.h from public files
- 4m44s -> 59s for baking 6 channel [at] 1024x1024 when baking materials on ProxyLOD for DATASET-0008a with shaders already compiled
- Time spent in Material Baking when rebuilding all HLOD on Apollo_POI_Large_HLOD (Phase 1 + 2 combined)
- 10m18s -> 2m36s for a first rebuild all in editor with no shaders in DDC (cold)
- 1m23s -> 20s for a second rebuild all in editor (warm)
#rb Jeremy.Moore, Sebastien.Lussier
CL 11135986 by sebastien.lussier
Optimized mesh merging
* Added DeletePolygons() & DeleteTriangles methods to FMeshDescription which rely on TSets<> instead of performing costly TArray::AddUnique() calls()
* Parallelized UV generation and avoided duplicate processing of the same mesh+lod pairs
* Optimized FMeshDescriptionOperations::GenerateUniqueUVsForStaticMesh()
* Goes from 100s to 10s in my test case
#rb danny.couture, jeanfrancois.dube, richard.talbotwatkin
#ROBOMERGE-OWNER: sebastien.lussier
#ROBOMERGE-AUTHOR: sebastien.lussier
#ROBOMERGE-SOURCE: CL 11206337 via CL 11206341 via CL 11206346
#ROBOMERGE-BOT: (v643-11205221)
[CL 11206493 by sebastien lussier in Main branch]