Commit Graph

67 Commits

Author SHA1 Message Date
trapper mcferron
9460d774b1 Build fix - rename to prevent global namespace conflicts
Original CL:
Commit 1 of 3 - Decoupling ISMPool from GeometryCollection

Create a copy of the GC_ISM pool files in its own Runtime/Experimental folder.  This allows our non-GC assets to take advantage of the ISMPooling and custom instance data.

#rb cedric.caillaud

[CL 35979457 by trapper mcferron in ue5-main branch]
2024-09-03 16:09:07 -04:00
sebastien lussier
3eea399bed World Partition - HLOD: Improved hash computation to avoid unnecessary HLOD rebuilds in some cases
* Some of the code still relied on possibly non-persistent GetTypeHash()
* Fixed an issue with the transient Geometry Collection ISM Pool components getting a random value for their InstancingRandomSeed property.
* Improved verbose logging to ease debugging in the future

#rb Dominic.Couture, Richard.Malo, jeanfrancois.dube

[CL 35824182 by sebastien lussier in ue5-main branch]
2024-08-27 10:09:50 -04:00
jeremy moore
d3f8b2a0fd ISMPool: disallow nanite on managed ISMs with translucent materials.
Removes cases of log spam where we have translucent materials that disable nanite later in the pipeline when creating scene proxies.
#rb cedric.caillaud

[CL 35515823 by jeremy moore in ue5-main branch]
2024-08-13 19:18:47 -04:00
jeremy moore
9821e1307b Geometry collection fix for bug with duplicated ISMs on Editor representation.
Issue was that duplicating an actor in Editor would duplicate the ISMs in the object hierachy. Because the ISM Pool was marked as transient the ISMs would be left leaking when the duplicated actor's custom renderer reregistered and created new ISMs.

[CL 33139028 by jeremy moore in ue5-main branch]
2024-04-22 10:52:10 -04:00
trapper mcferron
ead47b2b54 Disable keep alive for ISM Components to prevent OOM on platforms with more limited memory
#rb cedric.caillaud, jeanfrancois.stamour

[CL 33125883 by trapper mcferron in ue5-main branch]
2024-04-19 20:57:58 -04:00
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