Commit Graph

62 Commits

Author SHA1 Message Date
trapper mcferron
6842413c93 Put shadow copy of custom instance data behind a cvar, most likely it will only be needed for debugging purpose.
#rb Jeremy.Moore

[CL 31341444 by trapper mcferron in ue5-main branch]
2024-02-09 10:59:46 -05:00
trapper mcferron
5432550652 Robomerge fix - use default arg for SetNum
Fixes this previous submission...

#rb jeremy.moore

If bAllowPerInstanceRemoval was set, an instance would be removed if the transform scale is 0 and readded when transform scale is valid.  The process of removing it erases its custom instance data and there is no way to restore it when the instance is readded.

This CL makes a shadow copy of the custom instance data if bAllowPerInstanceRemoval is set which allows the process of readding the instance to also restore its custom instance data.


#changelist validated
#virtualized

[CL 31241459 by trapper mcferron in ue5-main branch]
2024-02-06 19:33:42 -05:00
trapper mcferron
89b6eb78ba #rb jeremy.moore
If bAllowPerInstanceRemoval was set, an instance would be removed if the transform scale is 0 and readded when transform scale is valid.  The process of removing it erases its custom instance data and there is no way to restore it when the instance is readded.

This CL makes a shadow copy of the custom instance data if bAllowPerInstanceRemoval is set which allows the process of readding the instance to also restore its custom instance data.


#changelist validated
#virtualized

[CL 31239930 by trapper mcferron in ue5-main branch]
2024-02-06 19:05:22 -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
benn gallagher
5ec2f5fb7f Added checks for nulled ISMs to transform updates on GeometryCollection pools. When ISM pools release all their instances they can be nulled and added to a free list that wasn't checked by the transform update loop.
#rb cedric.caillaud, Jeremy.Moore

[CL 30221248 by benn gallagher in ue5-main branch]
2023-12-08 17:46:18 -05:00
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