201 Commits

Author SHA1 Message Date
sebastien lussier
1e95527508 FStaticMeshOperations::GenerateUniqueUVsForStaticMesh() - Fallback to AutoUV if UVs are invalid or missing
#rb patrick.enfedaque

[CL 26039778 by sebastien lussier in 5.3 branch]
2023-06-16 03:31:53 -04:00
bryan sefcik
62d3f94e73 Removed public module dependencies because they aren't used by the module making them public and they create circular dependency issues.
#preflight 6478a35ec26e3b2449f1afcf
#jira

[CL 25745177 by bryan sefcik in ue5-main branch]
2023-06-01 17:53:45 -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
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
13a8673507 Merge Actor - Mesh merging: Fix incorrect handling of components with non uniform scaling in FMeshMergeHelpers::ExpandInstances()
* Use FMatrix as the conversion to FTransform can't handle non uniform scaling

#rb patrick.enfedaque
#preflight 63f7bb45dd78dd50f60568bb
#tests built HLOD for Asteria, no more floating pieces (a few neon signs were using ISMCs with non-uniform scaling)

[CL 24397797 by sebastien lussier in ue5-main branch]
2023-02-24 03:57:37 -05:00
ToniSeifert
797a945b77 #jira UE-135093
FHierarchicalLODUtilities::BuildStaticMeshForLODActor() - When adding impostors, should use the component transform rather than the actor transform

PR #8624: HLOD imposters take component instead of actor transform (Contributed by ToniSeifert)

#rb patrick.enfedaque

[CL 24393186 by ToniSeifert in ue5-main branch]
2023-02-23 18:58:41 -05: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
henrik karlsson
333d15ddb8 Added "const" behind operator== in various places in the code to resolve compile errors with latest msvc
#preflight 63c2fd31305002c6417a1fe9
#rb none

[CL 23720240 by henrik karlsson in ue5-main branch]
2023-01-14 18:41:31 -05:00
aidin abedi
ea9373ea7f Improve MeshMergeHelpers by adding option to apply component transform for static and skeletal meshes
#jira UE-173167
#preflight 63ae50d22540a78d275d2e99
#review-23560752 @sebastien.lussier

[CL 23674863 by aidin abedi in ue5-main branch]
2023-01-13 02:11:39 -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
michael balzer
035933e7b5 USplineMeshComponent: Rename GetAxisValue to GetAxisValueRef
#jira UE-172739
#9909
#preflight 639a76b38c64c74ac832d17c

[CL 23538907 by michael balzer in ue5-main branch]
2022-12-16 12:11:09 -05:00
christopher waters
7215f7d4ec Fully moving MaterialDomain to its own header.
#jira none
#preflight 639b4dc335203bc7aa695078

[CL 23531533 by christopher waters in ue5-main branch]
2022-12-15 16:01:51 -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
b5164ac775 Fixes to make modules compile with IWYU. We've added to IWYU toolchain so it compiles "orphaned" headers which does not have a owning cpp file. This identified lots of headers that couldn't be compiled by themselves (or if they were to included first)
Change consist of only forward declaration and additional includes

#preflight 63789c1de30d438849c48188
#rb none

[CL 23218412 by henrik karlsson in ue5-main branch]
2022-11-21 03:22:23 -05:00
sebastien lussier
727be799e6 World Partition - HLOD: Added null material check in FMeshMergeHelpers::FixupNonStandaloneMaterialReferences()
#rb trivial

[CL 23199917 by sebastien lussier in ue5-main branch]
2022-11-18 13:57:57 -05:00
jonathan bard
08e482fca9 Added support for landscape material instances (per-component MICs) for Nanite landscape:
* Refactored ExportToRawMesh function to allow exporting one mesh section per component
* Implemented support for UV mappings usually provided by the landscape vertex factory in the non-Nanite case (as per the LandscapeLayerCoords material expression + others)
* For Nanite landscape materials, the relevant UV channels are :
** Texcoords0-2 : TerrainCoordMapping_XY, TerrainCoordMapping_XZ, TerrainCoordMapping_YZ (note : TerrainCoordMapping_XZ doesn't work ATM because texcoords1 seems to be a special case...)
** Texcoords3 : WeightmapUV
** Texcoords4 : LightmapUV (not implemented by ExportToRawMesh yet and not supported by Nanite meshes ATM : max 4 UV channels)
** Texcoords5 : HeightmapUV (implemented by ExportToRawMesh but not supported by Nanite meshes ATM : max 4 UV channels)
* Nanite landscape meshes now have 1 polygroup per component, with the proper landscape material instance being assigned to it
* Since Nanite meshes are capped at 64 meshes per section, Nanite landscape mesh will now fail to build on proxies sporting more than this amount of components. This is a first implementation and can be fixed later by adding as many Nanite landscape components as needed
* Implemented some missing virtual overrides on FLandscapeMaterialResource leading to landscape material instances potentially being used for non-landscape usages (hair, etc.)
* Fixed LandscapeNaniteComponent not being attached to the root component (and the mesh being exported in world space coordinates), leading to it not following when moving the  actor
* Added NaniteLODIndex property in ALandscape to be able to tweak the LOD level used when generating the Nanite meshes. It's mostly a debug feature to test the LODLevel > 0 landscape mesh export and to accelerate the Nanite landscape mesh generation since you usually want Nanite to be the most defined mesh possible
* All Nanite landscape meshes will be auto-invalidated by this change

#rb roey.borsteinas, graham.wihlidal
#preflight 6365e2a2882365b8590525ac
#lockdown marc.audy

[CL 23069843 by jonathan bard in ue5-main branch]
2022-11-09 21:04:18 -05:00
henrik karlsson
4a5e13525d Fixed non-unity non-pch compile errors
#preflight skipped
#rb none

[CL 22788359 by henrik karlsson in ue5-main branch]
2022-10-26 16:22:34 -04: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