Commit Graph

72 Commits

Author SHA1 Message Date
ionut matasaru
a90718a7fb Fixed usage of TRACE_CPUPROFILER_EVENT_SCOPE macro(s) in various places.
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]
2021-01-19 06:29:15 -04:00
Krzysztof Narkowicz
4229937db8 Removed FMeshBuilder::Build(UStaticMesh* StaticMesh, TArray<FStaticMeshBuildVertex>& Verts, TArray<uint32>& Indexes, TArray<FStaticMeshSection>& Sections, uint32& NumTexCoords, bool& bHasColors). It's somewhat danegous as it leaks mesh descriptors and isn't used anymore.
#rb Brian.Karis

[CL 14602726 by Krzysztof Narkowicz in ue5-main branch]
2020-10-28 15:52:00 -04:00
Krzysztof Narkowicz
d5c90b01a3 Replaced descriptor get with a clone inside FStaticMeshBuilder::BuildMeshVertexPositions to lower memory usage during the mesh build process.
#rb Danny.Couture

[CL 14598717 by Krzysztof Narkowicz in ue5-main branch]
2020-10-28 09:56:58 -04:00
Krzysztof Narkowicz
3da3a205fb Added FMeshBuilder::BuildMeshVertexPositions. It replaces FMeshBuilder::BuildMesh(bool bBuildOnlyPosition = true) and does the minimal work which is required to extract vertex positions from a mesh descriptor.
This is later used to build static mesh derived data in cases where Nanite coarse mesh representation replaces original static mesh data and we can't depend on it. In extreme cases it lowers main thread derived data build time from ~7.5s to ~0.1s.

#rb Richard.TalbotWatkin

[CL 14578414 by Krzysztof Narkowicz in ue5-main branch]
2020-10-26 13:09:34 -04:00
Rune Stubbe
e46e841768 Large memory saving for Editor builds. ~5GB for Reverb P_World.
Removed unused and invalid WedgeMap from Nanite meshes.
#rb richard.talbotwatkins

[CL 14554459 by Rune Stubbe in ue5-main branch]
2020-10-23 05:42:03 -04:00
Krzysztof Narkowicz
5581ebef92 Generate mesh distance fields and Lumen card representation for Nanite meshes directly from the source mesh data. Nanite replaces static mesh data with a coarse mesh representation, which sometimes has holes in it or is not accurate enough. Building from the source data works around that issue and gets up the highest possible SDF/card quality. Unfortunately it also regresses static mesh import times by ~3-5% until we don't get async static mesh builds.
Mesh build numbers for Nanite meshes:
1701216 tris:
Static mesh build: 11.2s
Static mesh build for the SDF async task (added in this CL): 2.3s
Async SDF build: 0.7s
Async card rep build: 0.15s

5524435 tris:
Static mesh build: 36.4s
Static mesh build for the SDF async task: 6.2s
Async SDF build: 1.2s
Async card rep build: 0.5s

1146238 tris
Static mesh build: 10.5s
Static mesh build for the SDF async task: 1.5s
Async SDF build: 0.6s
Async card rep build: 0.1s

#rb Daniel.Wright

[CL 14372405 by Krzysztof Narkowicz in ue5-main branch]
2020-09-22 23:04:05 -04:00
Brian Karis
8ad4d4a7cd Fixed determinism in build.
Fixed tangents not being derived resulting in no welding for mip0 of Nanite
Ignore bHasColor from mesh desc and check if any non-white.
Misc clean up

#rb rune.stubbe

[CL 14223322 by Brian Karis in ue5-main branch]
2020-08-31 17:49:41 -04:00
Marc Audy
a7c9001a94 Merging //UE5/Release-Engine-Staging to Main (//UE5/Main) @ 14075166
#rb
#rnx

[CL 14075271 by Marc Audy in ue5-main branch]
2020-08-11 01:36:57 -04:00
Brian Karis
9c649b520f Variable vertex size support from FMeshlet on. Still hardcoded on input to 2 UVs and no color.
#rb rune.stubbe

[CL 14053574 by Brian Karis in ue5-main branch]
2020-08-06 17:30:32 -04:00
danny couture
1e21af2a98 Memory optims for mesh building
[CL 13954290 by danny couture in ue5-main branch]
2020-07-28 09:08:15 -04:00
Richard TalbotWatkin
51d4cb3f66 Fully deprecated old MeshDescription APIs.
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]
2020-07-16 08:23:15 -04:00
Michal Valient
f79a46c14c - build errors and warning fixes
#fyi graham.wihlidal
#rb none

[CL 13835240 by Michal Valient in ue5-main branch]
2020-07-06 23:44:51 -04:00
Michal Valient
95d19f95b1 [REVERB] Merging //UE4/Private-Reverb-Development@13832732
#rb graham.wihlidal, rune.stubbe, brian.karis, andrew.lauritzen, jeff.farris

[CL 13834854 by Michal Valient in ue5-main branch]
2020-07-06 18:58:26 -04:00
Marc Audy
11f5b21210 Merging //UE5/Release-Engine-Staging @ 13752110 to Main (//UE5/Main)
#rnx

[CL 13753156 by Marc Audy in ue5-main branch]
2020-06-23 18:40:00 -04:00
Richard TalbotWatkin
4884bf9d9a First pass of MeshDescription API and format refactor.
- 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]
2020-05-28 10:56:57 -04:00
Josh Adams
aa9705149b Copying Private-LoadTimes-4.24 stream to Main. Biggest changes are in Materials/Shader memory freezing.
#rb none

[CL 11282608 by Josh Adams in Main branch]
2020-02-06 13:13:41 -05:00
JeanMichel Dignard
84facd6d15 Copy from dev-enterprise cl 11097196
#rb none
#rnx

[CL 11099277 by JeanMichel Dignard in Dev-Tools-Staging branch]
2020-01-23 16:28:59 -05:00
ryan durand
471d972e62 Updating copyright for Engine Developer.
#rnx
#rb none


#ROBOMERGE-SOURCE: CL 10869240 via CL 10869516 via CL 10869902
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870584 by ryan durand in Main branch]
2019-12-26 15:32:37 -05:00
alexis matte
9e7d085a5e Fix propagating vertex color to custom LOD
#rb ryan.schmidt, richard.talbotwatkin


#ROBOMERGE-OWNER: alexis.matte
#ROBOMERGE-AUTHOR: alexis.matte
#ROBOMERGE-SOURCE: CL 10681967 via CL 10684029 via CL 10684043
#ROBOMERGE-BOT: (v610-10636431)

[CL 10684074 by alexis matte in Main branch]
2019-12-12 14:40:57 -05:00
bob tellez
a9cc7133db Back out changelist 10672659. Possible cause of asset corruption
[FYI] Alexis.Matte


#ROBOMERGE-OWNER: bob.tellez
#ROBOMERGE-AUTHOR: bob.tellez
#ROBOMERGE-SOURCE: CL 10677601 via CL 10677680 via CL 10677713
#ROBOMERGE-BOT: (v610-10636431)

[CL 10677717 by bob tellez in Main branch]
2019-12-12 11:50:43 -05:00
alexis matte
7a86fb988a Fix propagating vertex color to custom LOD
#rb ryan.schmidt, richard.talbotwatkin


#ROBOMERGE-OWNER: alexis.matte
#ROBOMERGE-AUTHOR: alexis.matte
#ROBOMERGE-SOURCE: CL 10672659 via CL 10672742 via CL 10672749
#ROBOMERGE-BOT: (v610-10636431)

[CL 10672750 by alexis matte in Main branch]
2019-12-12 10:21:18 -05:00
danny couture
f618e01190 Allow creation of RenderMeshDescription directly from BulkData/RawMesh when MeshDescription is not in memory
Clear MeshDescriptions sooner to reduce memory usage on datasmith import
   - 37.92 GB -> 26.70 GB Peak Working Set when importing DATASET-0008a
   - 66.04 GB -> 52.33 GB Peak Working Set when importing DATASET-0022a

#jira UE-64172
#rb Richard.Talbot-Watkins

#ROBOMERGE-SOURCE: CL 9755311 in //UE4/Release-4.24/...
#ROBOMERGE-BOT: RELEASE (Release-4.24 -> Main) (v545-9751379)

[CL 9755316 by danny couture in Main branch]
2019-10-23 06:44:22 -04:00
Rolando Caloca
1a30325d6f Copying //UE4/Dev-RenderPlat-Staging@9551419 to //UE4/Main
#rb none
#rnx

[CL 9551447 by Rolando Caloca in Main branch]
2019-10-11 15:33:31 -04:00
JeanMichel Dignard
d4f0f4d3f2 Copying //UE4/Dev-Enterprise @ cl 9420543 to Dev-Main (//UE4/Dev-Main)
#rb none

[CL 9420574 by JeanMichel Dignard in Main branch]
2019-10-04 13:11:45 -04:00
Rolando Caloca
7632478918 Merging //UE4/Main@9388041 to Dev-RenderPlat-Staging
#rb none
#rnx

[CL 9389881 by Rolando Caloca in Dev-RenderPlat-Staging branch]
2019-10-03 09:26:00 -04:00