Commit Graph

57 Commits

Author SHA1 Message Date
michael forot
695d1227af Rebuild cluster geometry if the GC transform is scaled at runtime
#rb cedric.caillaud, michael.bao

[CL 30027786 by michael forot in ue5-main branch]
2023-11-30 18:11:12 -05:00
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
benn gallagher
ad527a1560 Fixed ensures when geometry collection ISM pools were updated but their render transform wasn't flagged as dirty.
#rb Cedric.Caillaud, Jeremy.Moore

[CL 29558052 by benn gallagher in ue5-main branch]
2023-11-08 08:29:29 -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
jeremy moore
ce4da3cc1c Set ISMPool static mesh after seeting material overrides.
The static mesh code does PSO precaching which calls Nanite::AuditMaterialsImp() which expects to find the correct override materials.

[CL 29198348 by jeremy moore in ue5-main branch]
2023-10-27 17:11:06 -04:00
jeremy moore
14ed360cf8 ISM has option to use a conservative bounds.
This will not iterate over all instances to recalculate the bounds on every instance add/remove/transform update. But instead will maintain a conservative bounds that can only grow.
This is an optimization for the case where we might have very high instance counts causing the bounds calculation to become very expensive.
It's off by default, and controlled by SetUseConservativeBounds().
Even when the option is turned on for an ISM, we keep the existing behavior whenever the number of instances is below r.InstancedStaticMeshes.ConservativeBounds.Threshold
#rb Ola.Olsson,Kenzo.terelst

[CL 29034857 by jeremy moore in ue5-main branch]
2023-10-24 03:24:43 -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
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
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
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
jeremy moore
8bb065a8e3 Fix unnecessary proxy recreate overhead when moving ISMPool components.
[CL 28814730 by jeremy moore in ue5-main branch]
2023-10-16 15:59:38 -04:00
jeremy moore
08ee3f9d09 Remove HISM support from ISMPool.
Raw ISM is faster for all our use cases.
HISM doesn't support permanant instance IDs.
#tests PIE

[CL 28757447 by jeremy moore in ue5-main branch]
2023-10-13 12:39:49 -04:00
jeremy moore
17c701613f ISMPool: Per instance removal is a setting on the mesh group instead of a cvar.
[CL 28738306 by jeremy moore in ue5-main branch]
2023-10-12 20:59:48 -04:00
jeremy moore
9f97230919 Fix early release of referenced ISM when all instances are hidden.
Add cvar to disable add/remove hidden instances from ISM Pool.

[CL 28722934 by jeremy moore in ue5-main branch]
2023-10-12 15:12:32 -04:00
jeremy moore
9a3a88cf4f [Backout] - CL28697434
[FYI] bob.tellez
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL28695832
[FYI] Jeremy.Moore
Original CL Desc
-----------------------------------------------------------------
ISMPool changed to use the new ISM InstanceId permanant handles.
ISMPool can remove/re-add instances from the ISM depending on whether they are being updated with a zero transform.
This can help keep ISM GPUScene cost down in the case where we are hiding (now removing) many instances.

[CL 28699352 by jeremy moore in ue5-main branch]
2023-10-11 23:18:41 -04:00
bob tellez
cafa30c81a [Backout] - CL28695832
[FYI] Jeremy.Moore
Original CL Desc
-----------------------------------------------------------------
ISMPool changed to use the new ISM InstanceId permanant handles.
ISMPool can remove/re-add instances from the ISM depending on whether they are being updated with a zero transform.
This can help keep ISM GPUScene cost down in the case where we are hiding (now removing) many instances.

[CL 28697470 by bob tellez in ue5-main branch]
2023-10-11 21:57:32 -04:00
jeremy moore
033caca80d ISMPool changed to use the new ISM InstanceId permanant handles.
ISMPool can remove/re-add instances from the ISM depending on whether they are being updated with a zero transform.
This can help keep ISM GPUScene cost down in the case where we are hiding (now removing) many instances.

[CL 28695869 by jeremy moore in ue5-main branch]
2023-10-11 20:59:44 -04:00
jeremy moore
482c757cdb Allow multiple meshids in a meshgroup to have the same staticmesh description
[CL 28661395 by jeremy moore in ue5-main branch]
2023-10-11 09:23:22 -04:00
jeremy moore
b57d6a4fd9 Fix crash due to incorrect transform array length being passed to ISMPool transform update.
The reason it can happen is due to a change in geometry collection build behavior that will be fixed.
This fix is to prevent crashes while that is worked on.

[CL 28649220 by jeremy moore in ue5-main branch]
2023-10-10 20:59:55 -04:00
cedric caillaud
4a5b1af75d Add the possibility for a geometry component to stop sending update to the custom renderer if any set
- Also make sure the ISM Pool sub components are properly attached to the root component

#rb michael.bao, jeremy.moore, benn.gallagher

[CL 28483114 by cedric caillaud in ue5-main branch]
2023-10-04 19:42:49 -04:00
jeremy moore
78434a48cc Fix typo checking the wrong variable before an early out.
[CL 28254562 by jeremy moore in ue5-main branch]
2023-09-26 19:15:34 -04:00
cedric caillaud
44d4dce255 GC ISM Pool : do not set the relative transform of the component if it is not necessary
this prevent the "Moveable" related  warnings in PIE

#rb jeremy.moore

[CL 27805309 by cedric caillaud in ue5-main branch]
2023-09-12 15:54:43 -04:00
jeremy moore
2c1068f688 Add support to set a custom instance data slot on geometry collection ISM pool instances.
[CL 27630881 by jeremy moore in ue5-main branch]
2023-09-06 08:12:44 -04:00
jeremy moore
e4b96a0b1d Add garbage collection to ISM pool.
[CL 27054469 by jeremy moore in ue5-main branch]
2023-08-11 20:20:15 -04:00