Commit Graph

489 Commits

Author SHA1 Message Date
jeremy moore
a5e85b59f6 GeometryCollectionComponents that have root proxies will now create root proxy static mesh components when there is no other render method enabled.
This deals with an edge case with geometry collection custom renderers. Custom renderers don't run in edition mode, and in editor we would expect to have mesh data available instead. But for UEFN editor with cooked data, the mesh data may already be removed (because it is not needed in cooked game).
#rb Shaun.Kime
[FYI] cedric.caillaud

[CL 31643010 by jeremy moore in ue5-main branch]
2024-02-20 08:48:42 -05:00
steve robb
f8d47335a4 Replaced RemoveAt(N, 1, EAllowShrinking::*) with RemoveAt(N, EAllowShrinking::*).
[CL 31626444 by steve robb in ue5-main branch]
2024-02-19 16:51:58 -05:00
chris caulfield
b4488c2f8b Chaos - add FBodyInstance::bUseMACD flag to enable Motion-Aware Collision Detection per particle
- flag is also used by GeomrteyCollections
- wire flag through to Chaos particles in the ControlFlags structure

NOTE: this flag isn't actually being used yet. It will be connected to the MACD feature in an upcoming change.

#rb Benn.Gallagher

[CL 31588117 by chris caulfield in ue5-main branch]
2024-02-16 19:01:12 -05:00
cedric caillaud
a1b4c43ebf Geometry collection : remove unused DummyBodyInstance property
Can save up to 400 bytes per component ( maybe lower based on which memory pool the component ends up be allocated in  )

#rb vincent.robert, chris.caulfield, benn.gallagher

[CL 31536693 by cedric caillaud in ue5-main branch]
2024-02-15 16:43:53 -05:00
jeremy moore
db683f9d64 Defensive check against null RestCollection in PSO Precache.
#rnx
#rb cedric.caillaud

[CL 31497666 by jeremy moore in ue5-main branch]
2024-02-14 18:00:34 -05:00
cedric caillaud
4d6701bef8 Geometry collection : fix removed piecers failing to shrink when the feature is enabled
- the issue was a consequence of the component space transforms computation optimization
- the code responsible to update the scale of the pieces now properly mark the component space transforms dirty  so the rendering reads the updated ones

#jira UE-202204
#rb Benn.Gallagher, vincent.robert

[CL 31485535 by cedric caillaud in ue5-main branch]
2024-02-14 13:54:17 -05:00
vincent robert
c1896a41bd Make consistent API by using GetX, SetX, GetP and SetP for physics particles
#jira UE-202397, PLAY-14685
#rb chris.caulfield, alex.mcadams, cedric.caillaud

[CL 31383921 by vincent robert in ue5-main branch]
2024-02-12 11:12:22 -05:00
jason kanagaratnam
ad4c384f4d Fixed a null pointer crash if a static mesh had multiple physics proxy mesh entries and one of them was null
#rnx

[CL 31273061 by jason kanagaratnam in ue5-main branch]
2024-02-07 17:06:58 -05:00
cedric caillaud
f3a4d80249 Unshelved from pending changelist '30895702':
Fix geometry collection dynamic data replication
- Some members of the structure were not properly netserialized
- Root data was always ignore
- Dynamic and static rep data were sharing the same VersionProcessed

#rb Chris.Caulfield, michael.bao

[CL 31244381 by cedric caillaud in ue5-main branch]
2024-02-06 21:11:45 -05:00
vincent robert
3563268c41 Store velocities and rotations in single precision in Physics particles
This is saving 40 bytes per particle
#rb chris.caulfield

[CL 31178234 by vincent robert in ue5-main branch]
2024-02-05 12:34:00 -05:00
michael bao
85644d554f if UGeometryCollectionComponent::SetSimulatePhysics needs to initialize the physics proxy it should go through the route of recreating the physics state to ensure that the physics state gets destroyed when the component is destroyed
#rb cedric.caillaud, Todd.Eckert

[CL 31132714 by michael bao in ue5-main branch]
2024-02-02 13:31:14 -05:00
jon sourbeer
ff5c37ea9b Fix for incorrect trace geometry being generated
[REVIEW] [at]cedric.caillaud [at]michael.bao [at]sergio.gardeazabal
#rb michael.bao, Sergio.Gardeazabal

[CL 30934087 by jon sourbeer in ue5-main branch]
2024-01-26 14:11:25 -05:00
steve robb
f029468598 Fixed up a lot of bool-taking container resize functions to take EAllowShrinking instead.
[CL 30729174 by steve robb in ue5-main branch]
2024-01-19 16:41:35 -05:00
kenzo terelst
24051b2cbf Rename FComponentPSOPrecacheParams to FMaterialInterfacePSOPrecacheParams - use shared version defined in PSOPrecache.h so it can be used outside of FPrimitiveComponent as well
[CL 30629794 by kenzo terelst in ue5-main branch]
2024-01-16 04:04:28 -05:00
chris caulfield
55beea5fe8 Chaos - sleeping fixes and behaviour improvement
- add debug draw to visualize sleep state
- implement SleepFamily system that was missing from Chaos (SleepThesholdMultiplier)
- SetV and SetW now wakes particles
- reduced default velocity smoothing used by sleep thresholds
- fix smoothed velocity for particles in awake islands (minor issue that made it slightly harder to go to sleep)
- don't use smoothed velocity for floating particles
- system top alloe reduced sleep thresholds for floating particles (cvar controlled, disable dby default)

#rb benn.gallagher

[CL 30608421 by chris caulfield in ue5-main branch]
2024-01-12 19:37:04 -05:00
sarah noonan
467c0e0269 Release unused slack memory in geometry collection rep data.
#rb cedric.caillaud, Michael.Forot

[CL 30502426 by sarah noonan in ue5-main branch]
2024-01-09 07:41:49 -05:00
vincent robert
091054745a No creating particle and geometry on Game Thread when creating a Geometry Collection.
Still creating geometry on the Physics Thread, otherwise a partial destruction issue occurs.
Setup query flag after particle and geometry creation
#rb cedric.caillaud
#fy chris.caulfield

[CL 30386282 by vincent robert in ue5-main branch]
2023-12-18 19:27:18 -05:00
cedric caillaud
9842d58a96 geometry collection : fix pre-placed geometry collection not properly setting collision when calling SetUseStaticMeshCollisionForTraces from construction script
- When placing in editor, construction script runs before physics proxy is set , which was not setting the collision properly
- Move the proxy side flag to be part of the simulation parameters, so that when the proxy get created it is properly set from the component bUseStaticMeshCollisionForTraces property

#rb emanuel.masciarelli, michael.bao, vincent.robert

[CL 30378857 by cedric caillaud in ue5-main branch]
2023-12-18 12:52:01 -05:00
benn gallagher
a7c12121a9 Handle geometry collection particles being decayed immediately on the physics thread and fix immediately decayed internal geometry collection clusters reporting their children as active.
#rb cedric.caillaud

[CL 30290897 by benn gallagher in ue5-main branch]
2023-12-13 08:53:16 -05:00
kenzo terelst
4450458128 PSO Precache miss fixes:
- precache PSOs for GeometryCollectionComponent without custom renderer
- precache PSOs for Volumetric fog materials
- precache PSOs for projected shadow rendering using depth pass processor with different depth stencil state and render target
- always precache shadow rendering PSOs for default stream (non Position and PositionAndNormalOnlyStream)

#rb benjamin.rouveyrol

[CL 30290345 by kenzo terelst in ue5-main branch]
2023-12-13 08:14:19 -05:00
aris theophanidis
26e4fec512 Addition of a warning in UGeometryCollectionComponent to catch GC that might be using bStripOnCook without bUseRootProxyForNavigation (resulting in exporting nothing).
#rb cedric.caillaud

[CL 30276242 by aris theophanidis in ue5-main branch]
2023-12-12 16:10:18 -05:00
cedric caillaud
2f9a56c50a Geometry collection: fix ivisible geometry collection when using ISM Pool but no root proxy meshes
#rb Jeremy.Moore

[CL 30243415 by cedric caillaud in ue5-main branch]
2023-12-11 13:44:33 -05:00
vincent robert
fb68621191 [Backout] - CL30213133
[FYI] vincent.robert
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL30211300
[FYI] vincent.robert
Original CL Desc
-----------------------------------------------------------------
Reduce array size to store only required particles.
Several array in the Geometry Collection are used to store particle. According to the max simulation level, not all particle are created.
Now array have their own size, the particle size and the transform size in the proxy is now distinguished.
This change save 55% of memory in initialization.
It also avoid to process all transforms, we now iterate only through particles which should be way faster.
#rb cedric.caillaud

[CL 30221091 by vincent robert in ue5-main branch]
2023-12-08 17:44:59 -05:00
vincent robert
3a8a8e02b7 [Backout] - CL30211300
[FYI] vincent.robert
Original CL Desc
-----------------------------------------------------------------
Reduce array size to store only required particles.
Several array in the Geometry Collection are used to store particle. According to the max simulation level, not all particle are created.
Now array have their own size, the particle size and the transform size in the proxy is now distinguished.
This change save 55% of memory in initialization.
It also avoid to process all transforms, we now iterate only through particles which should be way faster.
#rb cedric.caillaud

[CL 30213295 by vincent robert in ue5-main branch]
2023-12-08 12:11:16 -05:00
vincent robert
9df21ce019 Reduce array size to store only required particles.
Several array in the Geometry Collection are used to store particle. According to the max simulation level, not all particle are created.
Now array have their own size, the particle size and the transform size in the proxy is now distinguished.
This change save 55% of memory in initialization.
It also avoid to process all transforms, we now iterate only through particles which should be way faster.
#rb cedric.caillaud

[CL 30211315 by vincent robert in ue5-main branch]
2023-12-08 10:57:31 -05:00