115 Commits

Author SHA1 Message Date
Sebastien Lussier
cf996c14f9 Mesh Merging - Fix combination of FMeshProxySettings settings bReuseMeshLightmapUVs and bGroupIdenticalMeshesForBaking
#jira none
#rb philippe.deseve
#preflight 6453c0bf4d593c0b4289faf6

[CL 25335142 by Sebastien Lussier in ue5-main branch]
2023-05-04 10:49:57 -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
sebastien lussier
d5b66a61f2 Material Baking - Added optimized code path when baking a set of meshes with remapped UVs
* In this case, instead of baking each mesh material property to it's own buffer, we can write all the meshes to the same buffer as their UVs are already the final ones that do not overlap
* Memory usage is greatly reduced (in test case with ~300 materials to bake, peak is reduced by 5.5GB)
* A lot faster to process (~2x in most cases) as we are doing a single RT readback per baked material property
* We can also skip the final merge of the baked outputs, as we have a single one

Refactored the material baking module to have both code paths (single output and multi outputs) share as much code as possible

#rb jeanfrancois.dube
#preflight 63eba6e0284e76cdadbecb48

[CL 24226039 by sebastien lussier in ue5-main branch]
2023-02-14 22:23:44 -05:00
sebastien lussier
30d6de42e3 MeshMergeUtilities cleanup
* Moved material creation in MergeComponentsToStaticMesh() to a standalone utility function
* Deprecate bCreateMergedMaterial
#rb trivial

[CL 24197343 by sebastien lussier in ue5-main branch]
2023-02-13 20:06:39 -05:00
sebastien lussier
e4c7d97bef Mesh Merging - Lazily evaluate vertex data usage by the material, as it is costly and we can avoid it in a lot of cases
#rb jeanfrancois.dube

[CL 24179740 by sebastien lussier in ue5-main branch]
2023-02-13 12:54:26 -05:00
benoit deschenes
3ef3727c41 MeshMergeUtility - Fix a bug where collisions of ISM components were not merged correctly.
We new merge the collisions of all the instances in the ISM component, instead of a single collision instance using just the component transform.
Also exposing a utility function for getting the collision information of a list of components.

#rb Richard.TalbotWatkin
#jira UE-174128
#preflight 63c99511c503023ab929831e

[CL 23814991 by benoit deschenes in ue5-main branch]
2023-01-23 12:22:18 -05:00
Sebastien Lussier
294a4bc715 #jira UE-150232
Merging static mesh actors resulted in static mesh sockets getting lost
* Added a "Merge Mesh Sockets" option to the Mesh Merge Settings
#rb jeanfrancois.dube
#preflight 63c0b1e602024f93d8d2f6af

[CL 23672695 by Sebastien Lussier in ue5-main branch]
2023-01-12 20:32:31 -05:00
jeanfrancois dube
0ef655e225 Merge Actors: don't dirty the level when merging actors.
#jira UE-172242
#rb sebastien.lussier
#preflight none

[CL 23480073 by jeanfrancois dube in ue5-main branch]
2022-12-12 13:37:49 -05:00
sebastien lussier
0f3472fc8b Added FISMComponentBatcher which can be used to batch SMC & ISMC
Now used in place of duplicated code in:
* UHLODBuilder::BatchInstances()
* FMeshMergeUtilities::MergeComponentsToInstances
* FPackedLevelActorISMBuilder::PackActors
#rb patrick.enfedaque
#preflight 637f87defa348e84808f0c99

[CL 23261629 by sebastien lussier in ue5-main branch]
2022-11-24 13:48:05 -05:00
henrik karlsson
b5b86c796c This change is a strategical submit for a coming change that removes lots of includes in headers that are included by many files. This change contains adding of includes in files that previously got those includes transitively from other inclkudes
#preflight 6355d4940313c24974b2107b
#rb none

[CL 22783162 by henrik karlsson in ue5-main branch]
2022-10-26 12:57:32 -04:00
sebastien lussier
24e886f1c4 Merge Actor: Turn a UV generation error into a warning as a temp workaround for failing HLOD builds
* Will rework UV generation to be more resilient
#rb trivial
#preflight skip

[CL 22217711 by sebastien lussier in ue5-main branch]
2022-09-27 23:59:24 -04:00
sebastien lussier
e2b30272ba Merge Actor - Fix section/material mapping issue introduced by CL22158948
#rb patrick.enfedaque
#preflight skip

[CL 22205513 by sebastien lussier in ue5-main branch]
2022-09-27 10:17:21 -04:00
sebastien lussier
21dc3e393c Merge Actor: Fixed incorrect MeshDataIndex stored as the key to the MeshDataAwaitingResults map
#rb patrick.enfedaque

[CL 22165310 by sebastien lussier in ue5-main branch]
2022-09-23 20:45:24 -04:00
sebastien lussier
4c65a049b9 Detect failure of global UV remap and avoid a crash accessing the empty GlobalTextureCoordinates array
#rb patrick.enfedaque

[CL 22165253 by sebastien lussier in ue5-main branch]
2022-09-23 20:44:11 -04:00
sebastien lussier
2689dd71cb World Partition - HLOD: Added support for automatic texture sizing for Merged & Simplified HLODs
* Reused existing code to share it between all HLOD generation methods

#jira UE-161274, UE-156559
#rb patrick.enfedaque
#preflight 632927c99840225da23c49a5

[CL 22088941 by sebastien lussier in ue5-main branch]
2022-09-20 01:40:59 -04:00
sebastien lussier
f1d3663fa2 World Partition - HLOD
* Exposed proper Nanite generation settings: To control mesh fallback mesh generation, relative error is prefered over triangle percent
* Exposed "Support Ray Tracing" option
#preflight 632856a91c7511917a845ef2
#rb jeanfrancois.dube

[CL 22086940 by sebastien lussier in ue5-main branch]
2022-09-19 21:54:48 -04:00
nick darnell
8c6dccfce9 Core - Making some improvements to TObjectPtr, introducing some templating utilities so that we can better template match TObjectPtr vs UObject* pointers so that a single templated function can work for either.
Core - Added support for assigning a TObjectPtr<T> to a TScriptInterface just like you'd expect from a raw Object*.

Actor - Making a version of GetComponents that will work for TObjectPtr collections.  Additionally fixed several places in the engine where we're forcing the template parameter instead of allowing it to be determined automatically - which forced me to leave one of the GetComponent implementations, but I think we aught to remove it. e.g.

Don't Do

TArray<UPrimitiveComponent*> PrimComponents;
Actor->GetComponents<UPrimitiveComponent>(PrimComponents);

Do

TArray<UPrimitiveComponent*> PrimComponents;
Actor->GetComponents(PrimComponents);

Slate - Introducing support for collections of TObjectPtr<T>'s being used as source lists for the STableView.

#preflight 630f7af8e54ec9d581b03d65
[REVIEW] [at]Marc.Audy, [at]Steve.Robb, [at]Zousar.Shaker

[CL 21727328 by nick darnell in ue5-main branch]
2022-08-31 16:13:49 -04:00
benoit deschenes
cf4f142639 MeshMergeUtilities - Fix some logic that was locking the main thread while waiting for the StaticMesh async build to complete. Now the build is only triggered (by PostEditChange()) after we've done modifying the StaticMesh.
On a large test asset, this shaved off ~20 seconds on a ~1m50sec merge operation.

#rb Richard.TalbotWatkin
#preflight 630eaae3556fc14dce80cae6

[CL 21723945 by benoit deschenes in ue5-main branch]
2022-08-31 13:27:10 -04:00
sebastien lussier
ae47a6cb66 Fix crash switching levels after building HLODs
HLOD meshes were sometime referencing MaterialInstanceDynamic, that aren't assets (!RF_Standalone)
* MIDs are usually outered to the components they are assigned to
* Duplicate MIDs and outer them to the generated HLOD UStaticMesh
#rb jeanfrancois.dube
#preflight 6308dfc392620e5ec3b61103

[CL 21597931 by sebastien lussier in ue5-main branch]
2022-08-26 16:20:09 -04:00
kriss gossart
0422ca7705 Skeletal Mesh - Replace the newly created GetSkeletalMesh function by GetSkeletalMeshAsset so it matches the setter SetSkeletalMeshAsset function (which itself couldn't be named SetSkeletalMesh due to the function already existing and doing something else).
#rb Josie.Yang
#preflight 62fa2afeae3edb54c979492e
#jira none

[CL 21385959 by kriss gossart in ue5-main branch]
2022-08-15 09:26:50 -04:00
Josie Yang
6b15506e58 Replace direct access to SkeletalMesh object from USkinnedMeshComponent with GetSkeletalMesh function
#rb kriss.gossart
#preflight 62aafc9ada0af39a4783930a

[CL 20686007 by Josie Yang in ue5-main branch]
2022-06-16 09:14:04 -04:00
ryan schmidt
74aec81aab MergeActors: workaround for crash where unique material list is larger than number of unique sections
#rb jeanfrancois.dube
#preflight 621dae3c3e14f0c7e51bded0
#rnx
[FYI] sebastien.lussier

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 19197657 via CL 19202734 via CL 19207265 via CL 19210846
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19215690 by ryan schmidt in ue5-main branch]
2022-03-01 21:35:42 -05:00
sebastien lussier
4875b2627f #jira UE-132273
WP HLOD - Add Landscape support

Changes to support WP landscape material capture
* Moved IsValidBaseMaterial() from MeshMergeUtilities to MaterialUtilities
* Moved CreateProxyMaterialInstance() from MeshMergeUtilities to MaterialUtilities
* Added FCreateTexture2DParameters::bVirtualTexture
* Added FMaterialUtilities::ExportLandscapeMaterial() which doesn't need a list of primitives to hide (will only render the landscape component primitives)
* Added VT primming to ensure the captured textures have the expected resolution

#rb patrick.enfedaque
#preflight 6206a9e454003c49ad44c354

#ROBOMERGE-AUTHOR: sebastien.lussier
#ROBOMERGE-SOURCE: CL 18980162 in //UE5/Release-5.0/... via CL 18980592 via CL 18980979
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 18981032 by sebastien lussier in ue5-main branch]
2022-02-14 12:01:24 -05:00
brian karis
a208fbc50b Changed name on Nanite Proxy mesh to Nanite Fallback mesh.
Changed fallback settings to be largely error based with new property FallbackRelativeError.

Nanite builder will now provide the LOD fallbacks for all autogenerated LOD levels which is far faster than generating them from scratch.

#rb graham.wihlidal
#preflight 61f9e1fe9e4d23cd93b8d556

#ROBOMERGE-AUTHOR: brian.karis
#ROBOMERGE-SOURCE: CL 18820056 in //UE5/Release-5.0/... via CL 18820070 via CL 18822916
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18825066 by brian karis in ue5-main branch]
2022-02-02 08:19:56 -05:00
andrew davidson
3debbbd465 Fix FVector2D variant casts
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]
2022-02-02 01:45:23 -05:00