193 Commits

Author SHA1 Message Date
simon barratt
d8db353cb0 Adjusted error localisation keys to be more specific (and not duplicated)
[CL 26035739 by simon barratt in 5.3 branch]
2023-06-16 01:21:08 -04:00
simon barratt
31da8dcdc7 Catching of StaticMesh and FortBuilding errors with ContentWorker error codes
[CL 25858999 by simon barratt in ue5-main branch]
2023-06-07 17:28:13 -04:00
graham wihlidal
f44e4131c5 Changed Nanite::FResources member on static mesh render to an abstracted TPimplPtr<> to fully decouple NaniteResources.h from StaticMeshResources.h, avoiding costly full engine rebuilds whenever we iterate on Nanite, and provide us a mechanism going forward to move more of our API private.
#rb brian.karis, rune.stubbe
#fyi christopher.waters, juan.canada, yuriy.odonnell, henrik.karlsson
#preflight 6470360127390642751d5d60

[CL 25638055 by graham wihlidal in ue5-main branch]
2023-05-26 00:55:23 -04:00
Steve Robb
cdf61a7e2b Removed operator new (TArray) usage from headers.
#rb james.hopkin
#jira none
#preflight 6454fcdc4574b81df4e18dc5

[CL 25353357 by Steve Robb in ue5-main branch]
2023-05-05 09:13:53 -04:00
Rune Stubbe
737c77422f Nanite support for explicit tangents
#jira UE-166732
#rb brian.karis
#fyi graham.wihlidal, jamie.hayes
#preflight 644f9d045403400548450480

[CL 25282711 by Rune Stubbe in ue5-main branch]
2023-05-01 07:48:12 -04:00
graham wihlidal
0d2d57eb0b Added two missing error messages to BuildNanite that now prevent a failed build from continuing (and producing broken data and/or various ensures in the slow task dialog).
#preflight trivial
#jira FORT-582521
#fyi graeme.thornton

[CL 25109636 by graham wihlidal in ue5-main branch]
2023-04-19 12:50:34 -04:00
halfdan ingvarsson
d9d24a10d6 Skeletal Mesh: Allow creation, use and cooking of arbitrary per-vertex attributes on skeletal meshes.
#jira UE-141809
#rb alexis.matte, josie.yang
#preflight 643f3b0b8d0bcde49c23411f

[CL 25099619 by halfdan ingvarsson in ue5-main branch]
2023-04-18 21:22:54 -04:00
marc audy
08c0dfc0a2 Fix uninitialized VertexBounds in NaniteDisplacedMesh and GeometryCollection code paths causing incorrect Nanite Meshes.
- Modified Nanite::IBuilderModule::FInputMeshData to take FBounds3f instead of FBoxSphereBounds since NaniteBuilder doesn't require sphere bounds.
- Calculate VertexBounds in DisplaceNaniteMesh(...) and BuildMeshDataFromGeometryCollection(...)

#rb rune.stubbe
#preflight 64258edb973e609670eb2ef0
#lockdown marc.audy

[CL 24884479 by marc audy in ue5-main branch]
2023-04-01 02:40:07 -04:00
rune stubbe
edc7e61019 Fixed issue where Nanite fallback meshes with LODIndex>0 would be extremely low poly because PercentTriangles was uninitialized.
The initialization code for PercentTriangles was lost in 24853395, seemingly by mistake.

[REVIEW] [at]tiago.costa

[CL 24867875 by rune stubbe in ue5-main branch]
2023-03-31 02:43:52 -04:00
sebastien lussier
0c3948ad71 FBoxSphereBounds - Fixed many potential issues with bounds initialization containing the origin (0,0,0)
* Added a FBoxSphereBounds::Builder class to help avoid these kind of issues
#rb jeanfrancois.dube, patrick.enfedaque
[FYI] Graham.Wihlidal
#preflight 6419e677ec01de1664d3e95c

[CL 24739078 by sebastien lussier in ue5-main branch]
2023-03-21 16:38:42 -04:00
graham wihlidal
448c7ab768 Fix Nanite mesh build never releasing memory during builds by changing usage of GetOrCacheMeshDescription to CloneMeshDescription, to follow what non-Nanite mesh building is doing (clone from a cached copy if present like during editing tools, but during cook where nothing is caching, just make a copy without storing back to the cache).
#rb yuriy.odonnell, rune.stubbe
[FYI] danny.couture, zousar.shaker
#preflight trivial

[CL 24667634 by graham wihlidal in ue5-main branch]
2023-03-16 00:28:41 -04:00
graham wihlidal
11aa8b1399 Undo overlapping corner changes for now (addresses some failure to weld cases, and a better approach is under development for this).
#preflight trivial
[FYI] alexis.matte, jonathan.bard

[CL 24650853 by graham wihlidal in ue5-main branch]
2023-03-15 03:51:33 -04:00
graham wihlidal
50dcdb0fe5 Possible fix for rare crash in StaticMeshBuilder when assigning accessing mesh description
#preflight trivial

[CL 24622109 by graham wihlidal in ue5-main branch]
2023-03-13 17:24:03 -04:00
graham wihlidal
60b68c4c39 Another non-unity fix
#preflight skip

[CL 24602830 by graham wihlidal in ue5-main branch]
2023-03-10 22:23:27 -05:00
graham wihlidal
d865a1b50c Robomerge and unity fixes
#preflight trivial

[CL 24602825 by graham wihlidal in ue5-main branch]
2023-03-10 22:23:03 -05:00
graham wihlidal
f92a4f5137 Fully de-interleaved attribute data during static mesh, Nanite, and geometry collection builds to save ~50% (on average) CPU memory across the board during SM builds.
#rb brian.karis
[FYI] yuriy.odonnell, danny.couture, rune.stubbe, ola.olsson
#preflight 640bb519af3fc35292eff3e6

[CL 24602822 by graham wihlidal in ue5-main branch]
2023-03-10 22:22:45 -05:00
graham wihlidal
1aec7d15e9 Significant DDC memory and perfomance optimizations to Nanite landscape mesh builds (and some general optimizations to all Nanite mesh builds). In some content cooks with extremely dense Nanite landscape mesh where the process memory well exceeded ~22gb, this brings it down to ~13gb, along with faster processing times.
Highlights:

 * Only allocate and use a wedge map for non-Nanite LODs, or if the mesh is sub 300kindices and it will be cache optimized
 * Only allocate and use a remap if there are no overlapping corners
 * When the Nanite landscape mesh is created, we now ensure the mesh description is fully compacted, computed, and optimized prior to committing it, along with making sure there are no overlapping corners.
 * Since Nanite landscape is checked to ensure no overlapping corners before the build, we can also now skip computing the overlapping corners, which was an intense number of tiny allocations.
 * When Nanite landscape is being built as a static mesh, we now avoid super expensive temporary copies of the mesh description, knowing that no actual mutation will occur.
 * The original code (after building) would release the memory from the mesh description copy, but it would not release the original immutable cached copy from memory (now that is released too)
 * Fixed NaniteLODIndex incorrectly creating a mesh description at a LOD other than the expected 0
 * Removed a full loop over all vertex positions by calculating the bounding box while we're building the vertex buffer (and already processing every vertex)
 * Added a NeedsCompact() helper to MeshDescription to avoid expensive and unnecessary Compact() calls that do lots of reallocs/copies even if the mesh description is already contiguous\packed in memory.
 * Skip building distance field and mesh card representations for the Nanite landscape mesh, which also avoids more cached mesh description deserialization and copies into memory.

Note: In the near future the APIs around this wil be cleaned up further.

#rb richard.talbotwatkin, yuriy.odonnell
[FYI] zousar.shaker, brian.karis, rune.stubbe, juan.canada, danny.couture
#preflight 640b7390482188d710464d39

[CL 24601442 by graham wihlidal in ue5-main branch]
2023-03-10 20:03:17 -05:00
tiago costa
3d3741df2b Prevent crash when trying to build Nanite Data for mesh with unsupported number of sections.
#preflight 63fd4163dd78dd50f6bee3d0
#rb graham.wihlidal, michael.balzer

[CL 24439073 by tiago costa in ue5-main branch]
2023-02-28 00:39:57 -05:00
brian karis
d1901ae146 Added Nanite static mesh setting: Fallback target.
This is an enum to say which target to reduce to for the fallback. It makes the default "Auto" which gives us more ability to change the default heuristic without needing to change uproperty defaults.

Along with this added r.Nanite.Builder.FallbackTriangleThreshold. Any mesh with source triangle count less than this threshold uses the source triangles directly for the fallback.

#rb graham.wihlidal
#lockdown marc.audy

#preflight 63f0041b1d71bcd26225228c

[CL 24330590 by brian karis in ue5-main branch]
2023-02-20 18:59:18 -05:00
graham wihlidal
70fd7c02c5 Refactored places fetching the result of NaniteSettings.bEnabled to instead get the value from UStatic::IsNaniteEnabled() so it correctly includes the force flag (except places using it to determine whether settings should be set).
#fyi brian.karis
#preflight trivial

[CL 24291376 by graham wihlidal in ue5-main branch]
2023-02-17 16:35:05 -05:00
graham wihlidal
521b800102 Implemented an "Allow Masked Materials" world setting that can force any any Nanite meshes using masked materials to fallback to non-Nanite rendering (default is to always use Nanite). SMC now also has a "Force Nanite for Masked" checkbox (false by default) that can be use to always use Nanite for masked materials, regardless of the world setting disallowing Nanite. Additionally this change also adds a cvar that can force all meshes to build Nanite data, even if the per-asset enabled checkbox is false.
#rb rune.stubbe
#fyi juan.canada, brian.karis
#preflight skip

[CL 24224547 by graham wihlidal in ue5-main branch]
2023-02-14 20:00:38 -05:00
dan thompson
ee896287b8 Warn when building a static mesh that has NaNs in it.
#rb charles.bloom
#preflight 63e6a891c23d1f29a3fbb411

[CL 24137697 by dan thompson in ue5-main branch]
2023-02-11 12:51:08 -05:00
richard talbotwatkin
da0d791bf7 Fixed issue where non-compact mesh descriptions can build with unused extra data.
#rb
#preflight

[CL 23580211 by richard talbotwatkin in ue5-main branch]
2023-01-04 15:47:28 -05:00
alexis matte
c4765e5da4 Do not cache the MeshDescription triangles/vertices count when we load the mesh description. Setting the cache when building the renderdata is good enough and it can use the already computed "FOverlappingCorners".
#jira UE-172554
#rb danny.couture
#rnx
#preflight 639772422540a78d27c8813f

[CL 23499862 by alexis matte in ue5-main branch]
2022-12-13 18:17:40 -05:00
alexis matte
4897d11583 Add Absolute criterion to staticmesh FMeshReductionSettings.
#rb brian.karis , jeanluc.corenthin , richard.talbotwatkin
#rnx
#preflight 638e35291776b8c21c32026b

[CL 23399365 by alexis matte in ue5-main branch]
2022-12-05 16:24:30 -05:00