131 Commits

Author SHA1 Message Date
sebastien lussier
5853cdaa77 Mesh Merge: Fix potentially invalid material baking result when using settings to strip out UV channels from the final mesh
* All valid UV channels must be kept during material baking
#tests enginetest
#rb JeanFrancois.Dube

[CL 35033880 by sebastien lussier in ue5-main branch]
2024-07-23 17:00:24 -04:00
sebastien lussier
0b94283c5b Fixed crash occurring when building HLODs after having built light maps
#jira UE-217782
#rb jeanfrancois.dube

[CL 34941673 by sebastien lussier in ue5-main branch]
2024-07-19 15:40:46 -04:00
sebastien lussier
9eb6eacf16 Mesh Merge - Prevent invalid mesh inputs from generating a static mesh asset with no source data
#rb JeanFrancois.Dube

[CL 34736879 by sebastien lussier in ue5-main branch]
2024-06-28 09:37:32 -04:00
sebastien lussier
266ea40bff World Partition - HLOD: Avoid the creation of reverse index buffers when building HLODs
* Reversed index buffers are used to handle negative scaling transforms. Since HLOD meshes will never be used with such transforms, we can get rid of these buffers and reduce memory usage.
#jira UE-216169
#rb JeanFrancois.Dube

[CL 34065502 by sebastien lussier in ue5-main branch]
2024-06-03 10:23:45 -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
sebastien lussier
770405be04 Merge Actor - Mesh Merging: Correctly handle MID when merging meshes but not their materials
* Duplicate the MID and outer it to the generated static mesh
#rb JeanFrancois.Dube

[CL 32762555 by sebastien lussier in ue5-main branch]
2024-04-05 12:14:58 -04:00
sebastien lussier
697585b8a1 Fix crash when baking materials on corrupted actor with StaticMeshComponent
* Shielded the utility methods from bad input
* Disabled the Bake Material button in case the operation isn't possible.
#jira UE-209285
#rb JeanFrancois.Dube

[CL 32576630 by sebastien lussier in ue5-main branch]
2024-03-28 10:09:19 -04:00
sebastien lussier
70eb0e1bf4 MergeMergeUtility - Fix broken hash computation in FProxyMeshDescriptor
* Return values of TypeCrc32() was ignored in some cases
#rb JeanFrancois.Dube

[CL 32300997 by sebastien lussier in ue5-main branch]
2024-03-18 11:06:55 -04:00
sebastien lussier
5115db18b1 Merge Actor - Properly handle custom primitive data when baking materials
* Forward custom primitive data info to material baking
* Added Custom Primitive Data case to material baking engine test
* Also updated broken Material Baking tests screenshots as subtle differences are now occuring on shadows... Disabled shadows from the map light source to minimize noise in future test results
#rb JeanFrancois.Dube

#virtualized

[CL 32298478 by sebastien lussier in ue5-main branch]
2024-03-18 09:05:54 -04:00
sebastien lussier
76f709ff39 Merge Merging - Fix crashes occurring when a GC was performed during mesh merging
#rb JeanFrancois.Dube

[CL 31433487 by sebastien lussier in ue5-main branch]
2024-02-13 12:32:01 -05:00
sebastien lussier
25561e8452 Merge Actor - Textures created with the "Merge" option are not visible in the Content Browser
#jira UE-203393
#rb jeanfrancois.dube

[CL 31267432 by sebastien lussier in ue5-main branch]
2024-02-07 14:47:07 -05:00
sebastien lussier
f67194e865 Cleaning up deprecated methods
#rb jeanfrancois.dube

[CL 31257115 by sebastien lussier in ue5-main branch]
2024-02-07 10:07:39 -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
sebastien lussier
0af6dcbbc1 Merge Actor - Mesh Merge: Fix corner case where a merged mesh section was assigned an invalid material index (INDEX_NONE)
* Required a source mesh with two sections with identical materials
* Occured only when created a merged mesh without baking down textures
#jira UE-201699
#rb Patrick.Enfedaque

[CL 30245768 by sebastien lussier in ue5-main branch]
2023-12-11 14:29:20 -05:00
sebastien lussier
0fdff1ee1f MergeActor - Improved UV generation of merged/simplified meshes
Currently controlled globally with the MeshMergeUtilities.UVGenerationMethod cvar
-> 0 - Engine default - (currently Patch Builder)
-> 1 - Legacy
-> 2 - UVAtlas
-> 3 - XAtlas
-> 4 - Patch Builder

#rb jeanfrancois.dube

[CL 29842440 by sebastien lussier in ue5-main branch]
2023-11-20 10:37:32 -05:00
tiago costa
62242df915 Moved IsStaticLightingAllowed() to RenderUtils.h and replaced relevant usage.
#rb ola.olsson

[CL 27557666 by tiago costa in ue5-main branch]
2023-09-01 12:07:26 -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
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