207 Commits

Author SHA1 Message Date
halfdan ingvarsson
8f680cf051 Skeletal Mesh: Change storage of morph target normals to be on vertex instances rather than vertices, to match how the base normals are stored. Add a backward compatibility path for skeletal meshes imported from Alembic files that have manually constructed UMorphTargets to support non-standard normals on the morph targets.
#jira UE-204464
#rb benoit.gadreau
#rnx

[CL 31566461 by halfdan ingvarsson in 5.4 branch]
2024-02-16 11:01:49 -05:00
alexis matte
9ccad7be42 Interchange: Fix skeletal mesh reimport: custom LODs, Alternate skin profiles and Cloth binding are now re-importing properly.
- Also fix the legacy alternate skinning if there is custom LODs in the asset. The alternate skin profiles are not lost anymore

#jira UE-205049 , UE-204958 , FORT-705238
#rb JeanLuc.Corenthin
#rnx

[CL 31337398 by alexis matte in 5.4 branch]
2024-02-09 09:19:36 -05:00
halfdan ingvarsson
551d79bfff Skeletal Mesh: Allow importing alt influence meshes with mismatched bones.
#rb kiaran.ritchie
#jira UE-204814
#rnx

[CL 30869791 by halfdan ingvarsson in 5.4 branch]
2024-01-24 19:46:11 -05:00
halfdan ingvarsson
b692d6e175 Skeletal Mesh: Change the import storage to use FMeshDescription instead of FSkeletalMeshImportData. This includes deprecating the USkeletalMesh::LoadLODImportedData and friends, in lieu of an API more similar to the one on UStaticMesh (GetMeshDescription/CommitMeshDescription/etc).
#jira UE-166343
#rb Alexis.Matte, benoit.gadreau, john.vanderburg

[CL 30711382 by halfdan ingvarsson in ue5-main branch]
2024-01-19 00:37:06 -05:00
jimmy andrews
230b4408b7 fix incorrect scaling of tangents w/ non-uniform BuildScale in StaticMeshBuilder, but support still using incorrect scaling as a legacy option on static mesh (enabled on existing meshes that have non-uniform build scales, and disabled on all new meshes or meshes with uniform build scale). Add the legacy option flag to the static mesh DDC key suffix so that the mesh is rebuilt when the flag changes.
#rb Alexis.Matte, David.Hill, Richard.TalbotWatkin

[CL 29964987 by jimmy andrews in ue5-main branch]
2023-11-28 13:43:35 -05:00
alexis matte
9bf35f960c Make sure importers do not allow nan or infinite float mesh data.
Also make sure the static mesh build fix those issue before building the mesh description.

#rb jeanluc.corenthin
#rnx

[CL 29314418 by alexis matte in ue5-main branch]
2023-11-01 09:26:52 -04:00
tiago costa
1334d92ec1 Removed some code related to Nanite Coarse Mesh Streaming
- don't modify DDC key based on cvar since it doesn't impact LOD generation since CL 18820056.
- removed bGenerateCoarseMeshStreamingLODs parameter from a few functions since it isn't used anymore.

#rb brian.karis
#prelight 652516f53a59af0b367fbd0b

[CL 28614902 by tiago costa in ue5-main branch]
2023-10-10 07:29:08 -04:00
alexis matte
2a152ff6e2 Downgrade a log verbosity from Error to Display to avoid breaking the CIS.
#rb trivial
#rnx

[CL 27956157 by alexis matte in ue5-main branch]
2023-09-18 09:50:56 -04:00
alexis matte
8872049eea Make sure Hires mesh number of sections is equal or lower than LOD 0 number of sections. Issue an Error log if the hires is invalid and default nanite on the LOD 0.
#jira UE-194416
#rb jeanluc.corenthin
#rnx

[CL 27893484 by alexis matte in ue5-main branch]
2023-09-14 16:24:58 -04:00
alexis matte
eb0a09d380 [Backout] - CL27835483
[FYI] Alexis.Matte
Original CL Desc
-----------------------------------------------------------------
Make sure Hires mesh number of sections match LOD 0 number of sections.
#jira UE-194416
#rb jeanluc.corenthin
#rnx

[CL 27853575 by alexis matte in ue5-main branch]
2023-09-13 17:45:11 -04:00
alexis matte
a76f93ad5b Make sure Hires mesh number of sections match LOD 0 number of sections.
#jira UE-194416
#rb jeanluc.corenthin
#rnx

[CL 27835504 by alexis matte in ue5-main branch]
2023-09-13 12:21:38 -04:00
tiago costa
abca6b5a6c Resubmit CL26160360, 26146080, 26137852, 26126752
Only leaving CL 26157603 reverted since accessing GenerateSource in FDistanceFieldVolumeData::CacheDerivedData is not safe due to async mesh compilation.

#prelight 64948190a26e02126bc0a64f
#rb Krzysztof.Narkowicz

[CL 26206875 by tiago costa in ue5-main branch]
2023-06-23 04:28:57 -04:00
bob tellez
4c7e2e1b32 [Backout] - CL26160360, 26157603, 26146080, 26137852, 26126752
[FYI] tiago.costa
Original CL Desc
-----------------------------------------------------------------
Use FSignedDistanceFieldBuildSectionData when generating distance fields for Nanite meshes.

Context:
- Nanite meshes distance fields are generated using the original mesh data instead of the coarse representation generated by Nanite, however that code path was not checking section data such as blend mode, two sided, etc.

Fix:
- Modified FStaticMeshBuilder::BuildMeshVertexPositions(...) to also output a FStaticMeshSectionArray.
- Updated MeshRepresentation::SetupEmbreeScene(...) to check section flags when using SourceMeshData.IsValid() code path.

#prelight
#rb Krzysztof.Narkowicz

[CL 26174853 by bob tellez in ue5-main branch]
2023-06-22 00:25:01 -04:00
tiago costa
2b73cf0aa3 Use FSignedDistanceFieldBuildSectionData when generating distance fields for Nanite meshes.
Context:
- Nanite meshes distance fields are generated using the original mesh data instead of the coarse representation generated by Nanite, however that code path was not checking section data such as blend mode, two sided, etc.

Fix:
- Modified FStaticMeshBuilder::BuildMeshVertexPositions(...) to also output a FStaticMeshSectionArray.
- Updated MeshRepresentation::SetupEmbreeScene(...) to check section flags when using SourceMeshData.IsValid() code path.

#prelight
#rb Krzysztof.Narkowicz

[CL 26160411 by tiago costa in ue5-main branch]
2023-06-21 16:17:07 -04:00
simon barratt
4f8613a16f Adjusted error localisation keys to be more specific (and not duplicated)
[CL 26007802 by simon barratt in ue5-main branch]
2023-06-15 06:01: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