Commit Graph

385 Commits

Author SHA1 Message Date
jeremy moore
f3aa01fb82 Add ISMPool option to not pay cost of ISM component update and ISMPool Tick associated with preallocation.
[CL 29683832 by jeremy moore in ue5-main branch]
2023-11-13 10:09:25 -05:00
michael bao
c74837a2fa geometry collection should track its previously set world transform external so the GT can compute the difference between the two if needed (e.g. if it needs to query the difference prior to the PT->GT sync)
#rb cedric.caillaud

[CL 29673947 by michael bao in ue5-main branch]
2023-11-11 16:24:45 -05:00
cedric caillaud
4b029f888c Fix rendering offsets with cluster unions
- This is caused by the  transform not being properly defined when receiving a ComponentAdded event
- Override ChildToParentUpdated method to update the rendering transform

#rb michael.bao, chris.caulfield, michael.lentine

[CL 29615742 by cedric caillaud in ue5-main branch]
2023-11-09 18:50:49 -05:00
sergio gardeazabal
abf12ea202 [Chaos] Making RefreshCustomRenderer on Geometry Collection Component public so other objects can force an update if needed.
Also updated a class to make use of this method until we find a better solution.

[REVIEW] 654bd7ca7236ad045f24f2ce

[CL 29581933 by sergio gardeazabal in ue5-main branch]
2023-11-08 19:23:55 -05:00
jeremy moore
d2a0916428 ISMPool, fix issue where preallocation queue contains raw object pointers that can be invalid by the time we process the entries.
Use weak object pointers instead.

[CL 29533102 by jeremy moore in ue5-main branch]
2023-11-07 16:19:51 -05:00
benn gallagher
0b807dc2c1 Added the ability to set ISM components in Geometry Collection ISM pools to just use their parent bounds and change their transform mode to absolute.
This allows the actor containing the ISM components to have full control over the root transforms of each ISM for faster or customised processing.

#rb Cedric.Caillaud, Jeremy.Moore

[CL 29419013 by benn gallagher in ue5-main branch]
2023-11-03 16:01:49 -04:00
titouan deslandes
2a57b8f063 Deprecated COPY_ON_WRITE_ATTRIBUTE and Indirect TManagedArray, removed CopyOnWriteAttributeList saving 200 bytes per GC.
Use the RestCollection to access those attributes instead.

#rb cedric.caillaud

[CL 29289224 by titouan deslandes in ue5-main branch]
2023-10-31 16:28:26 -04:00
michael forot
21de6da55b Call FlushNetDormancy only when some replicated property are changing to avoid replicating all GCs and preventing the repmovement to be replicated
#rb michael.bao

[CL 29272717 by michael forot in ue5-main branch]
2023-10-31 09:32:18 -04:00
todd eckert
a9c39581c6 Exposed some setters for various properties we were setting in construction scrips.
#rnx

[CL 29265865 by todd eckert in ue5-main branch]
2023-10-31 00:41:24 -04:00
chris caulfield
d0cb9a55f4 Geometry Collection - add OneWayInteractionLevel rather than IsOneWayInteraction to get more control over which particles behave like debris
#rb cedric.caillaud, michael.bao

[CL 29257116 by chris caulfield in ue5-main branch]
2023-10-30 19:23:20 -04:00
michael lentine
d3ed2bc54f Undo //Fortnite/Release-28.00/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/... changelist 29242678
#rb none

[CL 29256090 by michael lentine in ue5-main branch]
2023-10-30 18:49:35 -04:00
titouan deslandes
bad8f30386 Deprecated COPY_ON_WRITE_ATTRIBUTE and Indirect TManagedArray, removed CopyOnWriteAttributeList saving 200 bytes per GC.
Use the RestCollection to access those attributes instead.

#rb cedric.caillaud, vincent.robert, Benn.Gallagher

[CL 29246315 by titouan deslandes in ue5-main branch]
2023-10-30 15:57:51 -04:00
todd eckert
59ac23d5d7 Fixed an issue where prefab's were using the wrong physical material
see https://jira.it.epicgames.com/browse/PLAY-19518 and https://jira.it.epicgames.com/browse/PLAY-16871

#juno
#rnx

[CL 29166273 by todd eckert in ue5-main branch]
2023-10-26 22:17:13 -04:00
cedric caillaud
903f61073b Add partial destruction decay system for moving buildings
When the building is moving , check at regular interval if any partially destroyed geometry collection has been broken for certain amount of time since the building is moving
If so, then release it
- Cache the dynamic state in the cluster union component to avoid calling IsSimulatingPhysics()
- Added a virtual function called whenever the physics state of the cluster union is set

#rb benn.gallagher, michael.lentinne, michael.bao, chris.caulfield

[CL 29121109 by cedric caillaud in ue5-main branch]
2023-10-26 00:18:08 -04:00
sergio gardeazabal
6e5f317e4a UClusterUnionComponent::SyncClusterUnionFromProxy optimizations
- Removed the need of maintain two sets to cache FExternalSpatialAccelerationPayload structures as components are added/removed
- Added a new constructor to FExternalSpatialAccelerationPayload so we can directly pass a TObjectKey and the chaos UniqueIdx, so we don't have to build them from scratch (which requires lock the scene to get the Particle idx and access the Global objects array to build the WeakObjtPtr).
- Wrapped TObjectKey in a wrapper we can use to store other elements we will use later, so we don't have to go back and forth between converting between ObjectKey and Raw ptr which requires access to the global objects array and is not cheap.
- Removed TSet the need to do TSet differences
- Added a new native event that when broadcasted in addition to the new bone ids that were added, it also passes an array of bone IDs removed. (So listeners don't have to calculate it on their own again).
- Splitted UGeometryCollectionComponent::SetPerParticleCollisionProfileName so its components can be called independently. There are cases where we need to call it with different profile name witching the same scope, so part of the method doesn't need to be executed again. To ensure all parts are executed as desired, a new transaction object was created that need to be passed to the new UGeometryCollectionComponent::SetParticleCollisionProfileName

#rb cedric.caillaud, michael.bao

[CL 29119882 by sergio gardeazabal in ue5-main branch]
2023-10-25 23:28:31 -04:00
jeremy moore
f0e9080c6e Don't create render state for geometry collections using custom renderers
[CL 29072485 by jeremy moore in ue5-main branch]
2023-10-25 01:56:13 -04:00
tiago costa
6b9dce4b74 Added flag to control whether ISM cast far shadow in FGeometryCollectionISM.
#rb jeremy.moore

[CL 28975220 by tiago costa in ue5-main branch]
2023-10-20 14:52:53 -04:00
emanuel masciarelli
6d073fde45 Adding the ability for Geometry Collections to specify the use of the collision geometry from the source Static Meshes on the game thread instead of the combined GC collision, as the GC collision can be more coarse for improved physics simulation performance.
The cvar p.GeometryCollection.ForceOverrideGCCollisionSetupForTraces can be set to 1 to force GC collision on everything if anything goes sideways.

#tests PIE
#rb cedric.caillaud

[CL 28973051 by emanuel masciarelli in ue5-main branch]
2023-10-20 14:00:50 -04:00
jeremy moore
f987a64307 Add component keep alive option on ISMPool. This keeps ISM components alive when the last instance is removed. This avoids costly scene proxy creation for components that regularly switch between 0 and N instances.
The behavior is controlled by r.ISMPool.ComponentKeepAlive.
The old free list behavior is still supported and is now controlled by r.ISMPool.ComponentRecycle.
Both cvars can be safely enabled/disabled at runtime for testing.
Note that keep alive will effectively override recycling if both are enabled, since no components are released to the recycling free list.
#rb Cedric.Cauillaud

[CL 28966562 by jeremy moore in ue5-main branch]
2023-10-20 11:08:43 -04:00
cedric caillaud
64081c4b6d Geometry collection optimization : tick geometry collection only when there's at least a piece decaying
- Tracks broken and decayed states in an internal structure
- Simplifies the FullDecay check
- Removal function remain mostly intact but are open for optimization after this change since we can now query the broken state directly instead of inferring it from other more expensive state checks

#rb benn.gallagher, michael.bao, vincent.robert

[CL 28934664 by cedric caillaud in ue5-main branch]
2023-10-19 17:24:23 -04:00
jeremy moore
59065aca8d Add WPO evaluate flag for ISMPool.
Setting this can allow us to take the optimized path on nanite.

[CL 28890104 by jeremy moore in ue5-main branch]
2023-10-18 16:50:31 -04:00
vincent robert
82cd7138bb Lazy initializer for Dynamic removals attributes
#rb cedric.caillaud

[CL 28876234 by vincent robert in ue5-main branch]
2023-10-18 10:07:37 -04:00
cedric caillaud
f1642e667c ClusterUnion: Fix rendering of GC when in a cluster union
Also fix an uninitialized variable

#rb michael.bao, michael.lentine, jon.sourbeer

[CL 28865263 by cedric caillaud in ue5-main branch]
2023-10-17 21:07:50 -04:00
cedric caillaud
eb82e13ba7 Geometry collection optimization : improve reuse of cached component space bounds
- changed ComponentSpaceBounds to be an Fbox
- CalcBounds now do not check for dynamic collection but when the dynamic collection is modified the component space bounds are invalidated
- invalidation happens in OnPostPhysicsState and when rest transforms are updated
- Cached IsRootBroken state

#rb benn.gallagher, vincent.robert, brice.criswell

[CL 28846696 by cedric caillaud in ue5-main branch]
2023-10-17 14:28:19 -04:00
jeremy moore
9549ec6fe4 ISMPool per primitive max distance cull is now controlled with a flag rather than always set.
[CL 28829415 by jeremy moore in ue5-main branch]
2023-10-16 22:31:55 -04:00