456 Commits

Author SHA1 Message Date
balazs toereki
49aeaff3c8 [SkeletalMesh to StaticMesh] MaterialIndices fixes.
#jira UE-219101
#rnx
#rb Alexis.Matte

[CL 34931291 by balazs toereki in ue5-main branch]
2024-07-19 10:10:45 -04:00
sebastian schoner
a1e177e040 Explicitly handle out-of-memory errors from embree calls
When an embree call fails because it runs out of memory, we don't currently do much except locally return. As evidenced in UEFN cooks, this leaves the cook in an uncertain state that will fail later and isn't properly reported as a memory issue. We can instead invoke the existing codepath for reporting out-of-memory issues (which will also stop the process).

#rb Laura.Hermanns

[CL 33857109 by sebastian schoner in ue5-main branch]
2024-05-23 05:52:54 -04:00
sebastien lussier
02a0620a4d MergeActor - 1st pass cleaning up include files in order to avoid rebuilding the whole engine when editing merge actor settings
#rb JeanFrancois.Dube

[CL 33209699 by sebastien lussier in ue5-main branch]
2024-04-24 15:24:31 -04:00
steve robb
9c7affb850 Removed unused variables.
[CL 32969776 by steve robb in ue5-main branch]
2024-04-15 08:49:28 -04:00
graham wihlidal
222d5992e1 Minor code cleanup
#jira none

[CL 32495908 by graham wihlidal in ue5-main branch]
2024-03-26 00:02:49 -04:00
halfdan ingvarsson
74dd3f86a2 Skeletal Mesh: Create healthy tangents when reconstructing normals/tangents for render and the UVs are non-existent or degenerate.
#rb Alexis.Matte
#rnx

[CL 32236572 by halfdan ingvarsson in ue5-main branch]
2024-03-13 21:53:15 -04:00
sebastian schoner
36a6d2605d Change method of detecting overlapping vertices in SkeletalMeshTools to use FOverlappingCorners
BuildSkeletalMeshChunks is used during cooking when saving skeletal meshes (calls originate from USkeletalMesh::BuildLODModel, see linked jira ticket for full callstacks) and deduplicates overlapping vertices. In contrast to many other places in the engine, it is using a multimap instead of the FOverlappingCorners type. Using a multimap is technically more correct since "points overlap each other" is not an equivalence relation (it is not transitive, i.e. "A overlaps B" and "B overlaps C" but "A does not overlap C" is possible). FOverlappingCorners pretends that transitivity is given, because that is pretty much always true. Note also that there is another check later on for whether two vertices within the same cluster actually overlap.

In especially degenerate cases this can save a lot of memory because we only store each group of overlapping vertices once (instead of having a copy for every vertex in that group). With user content in UEFN, it is unfortunately very much possible to hit these degenerate cases, allocate gigabytes of memory, and have the cooking process terminate with an OOM error.

This CL changes this codepath to use FOverlappingCorners instead. The memory savings and time savings are significant, find a comparison here https://docs.google.com/document/d/1qHnY_6WXpcEmJL_61myQDczxG6XDZRuVUCE8yQ-FkDs/edit?usp=sharing

#rb alexis.matte, laura.hermanns

[CL 31119331 by sebastian schoner in ue5-main branch]
2024-02-02 04:00:56 -05:00
steve robb
6d5b974842 Fixed up a lot of bool-taking container resize functions to take EAllowShrinking instead.
[CL 30735396 by steve robb in ue5-main branch]
2024-01-19 19:41:56 -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
halfdan ingvarsson
e7d9a08b2d Skeletal Mesh: Remove the FBX import flags from FSkeletalMeshImportData. There's no need for them, since they can be maintained purely within the import cycle.
#jira UE-166343
#rb Alexis.Matte
#tests Editor.Import.Fbx.*

[CL 30099989 by halfdan ingvarsson in ue5-main branch]
2023-12-04 18:20:03 -05:00
tiago costa
1aa5e205b9 Replaced double precision members of FDistanceFieldVolumeData and FSparseDistanceFieldMip with single precision floats.
#rb Krzysztof.Narkowicz

[CL 29863953 by tiago costa in ue5-main branch]
2023-11-21 09:53:46 -05:00
sebastien hillaire
773b3c6731 Lumen - add capture of translucent meshes into lumen scene and card.
If hit lighting and refraction is not enabled, translucent meshes will be skipped, and translucent cards part of composed meshes won't be won't be dispatched.
#rb Krzysztof.Narkowicz

[CL 29507890 by sebastien hillaire in ue5-main branch]
2023-11-06 20:10:34 -05:00
Brice Criswell
50af62ae00 Import: Keep sections separate
-	Adds an option to not merge skeletal mesh sections sharing the same material during FBX import. This allows you to control visibility at a per-section level without having to give each section a unique material. [Github Pull Request: 9587]
#jira UE-164863
#rb Alexis.Matte, JeanLuc.Corenthin

[CL 26757306 by Brice Criswell in ue5-main branch]
2023-08-01 18:02:41 -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
bob tellez
4145327cc9 #UE disable a warning, for now
[FYI] tiago.costa

[CL 26142892 by bob tellez in ue5-main branch]
2023-06-21 03:26:51 -04:00
tiago costa
a6c0a01df7 Fix incorrect Distance Field / Card Representation when multiple mesh sections with different settings point to the same material slot
- Different mesh sections can point to the same material slot which was a problem since bAffectDistanceFieldLighting flag can be set per section but we were using an array with an entry per material slot instead of per section.
- To address this now we build array of FSignedDistanceFieldBuildSectionData (one entry per section) so section don't override each other.

#prelight 64921d9ab76bf403cda2f33f
#rb daniel.wright

[CL 26137888 by tiago costa in ue5-main branch]
2023-06-20 18:44:39 -04:00
marc audy
d1f48fc5c8 Fix implicit capture of this using [=] deprecated in C++20
#jira
#rnx

[CL 25989494 by marc audy in ue5-main branch]
2023-06-14 15:07:58 -04:00
halfdan ingvarsson
9c3950900b Skelmesh: Optimize import of alternative skin weights.
#jira UE-186957
#preflight 646e950df85111e06cc68d00
#rb alexis.matte

[CL 25635967 by halfdan ingvarsson in ue5-main branch]
2023-05-25 20:47:10 -04:00
bryan sefcik
91c57d395e Removed redundant module includes.
#preflight 645d4bf3aa3c584c0b5b3a67

[CL 25435653 by bryan sefcik in ue5-main branch]
2023-05-11 16:48:21 -04:00
halfdan ingvarsson
70b0b08c55 Fix for alternate skin weights blowing up.
#preflight 644766b8bd7cb48eeaa46472
#rnx

[CL 25176729 by halfdan ingvarsson in ue5-main branch]
2023-04-25 03:07:31 -04:00
kevin ortegren
f9272bdeba Embree device/scene is used even after they fail init. Fix crash by early out. (This matches the behavior of GenerateCardRepresentationData).
Failed Embree init will leave FDistanceFieldVolumeData::IsValid() returning false.

#rb tiago.costa, mihnea.balta
#rnx
#preflight 63ff868dae54ee4ce945432b

[CL 24471347 by kevin ortegren in ue5-main branch]
2023-03-01 16:53:19 -05:00
benoit deschenes
00ed0aec11 Fix StaticMeshToRawMeshes() not handling InstancedStaticMeshComponents properly. This fixes the "Convert to Static Mesh" tools.
#rb Alexis.Matte
#jira UE-178531
#preflight 63fccd38e32cdb7d9ad5befe

[CL 24427722 by benoit deschenes in ue5-main branch]
2023-02-27 13:29:47 -05:00
Krzysztof Narkowicz
81fd5a321a Lumen Mesh Cards - fixed hang when generating poorly constructred meshes and due to an EmbreeRay bug, EmbreeRay.ray.tfar.ray.tnear was further than EmbreeRay.ray.tfar
#preflight skip
#jira udn

[CL 24230480 by Krzysztof Narkowicz in ue5-main branch]
2023-02-15 10:25:39 -05:00