211 Commits

Author SHA1 Message Date
sebastien lussier
22e2777271 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 32499424 by sebastien lussier in 5.4 branch]
2024-03-26 02:22:45 -04:00
sebastien lussier
caf65130b5 Merge Merging - Fix crashes occurring when a GC was performed during mesh merging
#rb JeanFrancois.Dube

[CL 31430516 by sebastien lussier in 5.4 branch]
2024-02-13 11:26:23 -05:00
sebastien lussier
942f92c3b9 Merge Actor - Textures created with the "Merge" option are not visible in the Content Browser
#jira UE-203393
#rb jeanfrancois.dube

[CL 31265688 by sebastien lussier in 5.4 branch]
2024-02-07 14:00:23 -05:00
sebastien lussier
27297a206b Cleaning up deprecated methods
#rb jeanfrancois.dube

[CL 31257031 by sebastien lussier in 5.4 branch]
2024-02-07 10:05:11 -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
jamie hayes
adce377825 Fix race condition on FKAggregateGeom::GetGeom when rendering in parallel.
#rb zach.bethel

[CL 29787939 by jamie hayes in ue5-main branch]
2023-11-16 15:21:50 -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
dominic couture
8bc739dd3e This changelist contains various changes to allow the creation of FPrimitiveSceneProxy & FPrimtiveSceneInfos for meshes not associated with an AActor/UPrimitiveComponent pair. In other words, it's now possible to add primitives to FScene that aren't associated with AActors & UPrimitiveComponents. These are additional entry points, all existing code should continue to build & execute as is.
*Added FPrimitiveSceneDesc, a structure you can initialize with a description of the primitive you're trying to Add/Remove/Update in the FScene
-Added entry points in FSceneInterface to do those operations, legacy entry points using UPrimitiveComponent are untouched.
-The code that executes those operations in FScene has been refactored to be shared between the two entry points as much as possible to lessen the additional maintenance burden.


*Added FPrimitiveSceneProxyDesc/FStaticMeshSceneProxyDesc/FInstancedStaticMeshSceneProxyDesc, structures that hold all the necessary information to create a FPrimitiveSceneProxy/FStaticMeshSceneProxy/FInstancedStaticMeshSceneProxy without depending on AActors or UPrimitiveComponent.
-Those structures can be initialized by constructing them with the corresponding UPrimitiveComponents, or by constructing their default versions and initializing the desired fields.
-Creation code for FPrimitiveSceneProxy/FStaticMeshSceneProxy/FInstancedStaticMeshSceneProxy now takes all its info from those desc structures. They are created on demand during scene proxy creation for UPrimitiveComponents. This means no additional memory, and all serialized assets & blueprints are unaffected.


*Added IPrimitiveComponent/IStaticMeshComponent interfaces
-These allow for some editor-only interactions occurring during proxy creation, and serve as a common interface for some code that expected to manipulate UPrimitiveComponent/UStaticMeshComponents. For example FObjectCacheEventSink / FObjectCacheContext now uses those interfaces to associate the resources between various users and interactions like proxy recreation on shader/mesh changes occur through those interfaces.


* Misc
-Moved scene primitive related member variables into a new structure (FPrimitiveSceneInfoData) to facilitate code sharing and implementations of various related functionality (like SetLastRenderTime).
-Changed ObjectCacheContext to store associations between resources and components using component interfaces so that other systems creating proxies have the proper behaviors when resource changes require proxy recreation.
-Added natvis support so that component interfaces to UPrimitiveComponent/UStaticMeshComponent display the component ptr for easier debugging.
-Changed FMotionVectorSimulation to use UObject* instead of UPrimitiveComponent*, it was already using this internally
-Templatized some nanite helpers like ShouldCreateNaniteProxy & AuditMaterials since we need to use them from both UPrimitiveComponent & FPrimitiveSceneProxyDesc and it'll help make sure we keep them in sync.

#jira UE-191990

#rb Zach.Bethel, Ola.Olsson, Jason.Nadro, Krzysztof.Narkowicz

[CL 27200716 by dominic couture in ue5-main branch]
2023-08-18 09:26:39 -04:00
sebastien lussier
567b9098e9 FStaticMeshOperations::GenerateUniqueUVsForStaticMesh() - Fallback to AutoUV if UVs are invalid or missing
#rb patrick.enfedaque

[CL 26020789 by sebastien lussier in ue5-main branch]
2023-06-15 14:13: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