* Forward custom primitive data info to material baking
* Added Custom Primitive Data case to material baking engine test
* Also updated broken Material Baking tests screenshots as subtle differences are now occuring on shadows... Disabled shadows from the map light source to minimize noise in future test results
#rb JeanFrancois.Dube
#virtualized
[CL 32499424 by sebastien lussier in 5.4 branch]
- Also moved FPrimitiveUniformShaderParametersBuilder to its own header to cut down rebuilding when changing scene & nanite definitions.
#rb jamie.hayes
#preflight 644919d41c2846595cfdbf28
[CL 25199110 by Ola Olsson in ue5-main branch]
Previous fix only works when mesh data is a quad, this amended fix works for arbitrary mesh data.
#jira UE-183148
#review @Jason.Nadro
#preflight 643ef22fb550f425ace042c9
[CL 25095680 by aidin abedi in ue5-main branch]
2. Supports CustomDepth in translucency pass on mobile LDR.
#jira none
#rb Dmitriy.Dyomin
#preflight 62be9894d94b57687c68aed1
[CL 20911586 by Wei Liu in ue5-main branch]
#jira UE-122078
#rb Andrew.Davidson, Colin.McGinley
#preflight standard build
#ROBOMERGE-AUTHOR: fred.kimberley
#ROBOMERGE-SOURCE: CL 18817999 in //UE5/Release-5.0/... via CL 18818012 via CL 18822871
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)
[CL 18824721 by fred kimberley in ue5-main branch]
Submitted on behalf of fred.kimberley
#rb andy.davidson
#preflight 61f8719ea6632a34f35e654b
#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 18801709 in //UE5/Release-5.0/... via CL 18802160 via CL 18821533
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)
[CL 18821619 by andrew davidson in ue5-main branch]
* Added GroupIdenticalMeshesForBaking, which, when activated, will result in identical meshes (or mesh instances) being baked only once.
Other changes/fixes
* Always rely on the StaticMesh RenderData when retrieving mesh description for mesh merging/simplification (was the case when retrieving from a SMC, now also the case for a SM).
* For some reason, Material baking was rendering each triangle twice, but with opposite facing. Uneeded as we are rendering with backface culling disabled.
[CL 15669055 by Sebastien Lussier 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]
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]