Commit Graph

33 Commits

Author SHA1 Message Date
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
jeremy moore
625bf43130 Add option to spatially divide ISMs in the ISMPool.
Enable ISM pooling by default so that spatially placed ISMs can be recycled easily when moving through a streaming world.

[CL 27044402 by jeremy moore in ue5-main branch]
2023-08-11 16:28:11 -04:00
jeremy moore
a5c463b6af Fix inverted geometry in ISMPool
[CL 27017031 by jeremy moore in ue5-main branch]
2023-08-10 19:04:35 -04:00
jeremy moore
5582094518 GeomCollectionISMPool: Use mirrored identity primitive transform on ISMs that have been flagged for reverse culling.
Reverse culling is expected to be set when all instances have mirrored transforms.
Putting the mirror in the component transform will correctly set the primitve flags for use by shaders.

[CL 26952481 by jeremy moore in ue5-main branch]
2023-08-09 08:07:30 -04:00
jeremy moore
49cab1e61d Set MDC stat categories for some known subsystems.
[CL 26725198 by jeremy moore in ue5-main branch]
2023-07-31 18:48:44 -04:00
jeremy moore
41f3ad4b70 Move support of InstanceLODDistanceScale from HISM up to ISM.
The value is used to modify ScreenSize stored in MeshElement/MeshRelevance.
Note that we keep the convention from it's use in HISM that smaller values drive higher LODs.
That's the same convention as with foliage.LODDistanceScale but the inverse of r.StaticMeshLODDistanceScale.

[CL 26484027 by jeremy moore in ue5-main branch]
2023-07-20 09:03:37 -04:00
jeremy moore
720a94d498 GeometryCollection ISMPool add support for ISM GPU LOD.
Also add support for Velocity from WPO option and tidy up boolean options into flags.

[CL 26134927 by jeremy moore in ue5-main branch]
2023-06-20 17:15:13 -04:00
jeremy moore
6536105d10 Hide ISMPool ISMs when empty.
[CL 26075592 by jeremy moore in ue5-main branch]
2023-06-16 19:31:31 -04:00
jeremy moore
a0faa29fa4 Add tag support to ISMPool.
ISMPool uses serialized version of the default primitive custom data to allow us to copy paste ISMPools for debugging.
ISMPool uses fast version of hash combine.
Expose ISMPool actors getter from ISMPool subsystem.

[CL 25886022 by jeremy moore in ue5-main branch]
2023-06-08 19:39:06 -04:00
cedric caillaud
d1caeada52 Geometry collection rendering optimization
- Optimize the ISM Pool to use the instance static mesh array API for passing transform , avoiding local array allocation
- avoid sorting the removal indices twice by using the new instance static mesh view

#rb jeremy.moore, benn.gallagher
#preflight 646eccdc4422ba05f44bb942

[CL 25633600 by cedric caillaud in ue5-main branch]
2023-05-25 18:53:40 -04:00
jeremy moore
ed11df56f0 ISMPool: If ISM component has no component transform then we can ignore the bWorldSpace flag. This makes the maths simpler in the ISM Update call.
This is a quick fix for a perf hot spot, but we can still improve the underlying ISM code here to avoid multiple transform inverts when updating multiple instances.
#preflight 646278c4aa3c584c0b07ea96

[CL 25479015 by jeremy moore in ue5-main branch]
2023-05-15 15:51:09 -04:00
jeremy moore
609018f743 Add support for custom primitive data to ISM Pool
#preflight 64553f1bed7ffaa0f5cd919b

[CL 25365376 by jeremy moore in ue5-main branch]
2023-05-06 02:08:34 -04:00
jeremy moore
d6d0ae73fe Support preallocation of ISMs in the ISMPool
#preflight 643ef1609566b614505e2060

[CL 25096541 by jeremy moore in ue5-main branch]
2023-04-18 18:06:56 -04:00
jeremy moore
1dbe0a3999 Fix duplicated CVar
#preflight skip

[CL 25050220 by jeremy moore in ue5-main branch]
2023-04-14 17:06:14 -04:00
jeremy moore
8cd3ec16de ISM Pool sets ISM to use RemoveAtSwap remove behavior.
Assume RemoveAtSwap in group removal so that we can do local remapping logic and remove the more expensive delegate callbacks.
#preflight 64397c6a211b661dc418651a

[CL 25050206 by jeremy moore in ue5-main branch]
2023-04-14 17:05:40 -04:00
jeremy moore
ac9df1f5dc Add explicit remap arrays to the ISM Pool to manage mapping between the ISM Pool instance index and the ISM render instance index.
This costs some memory but makes the cost of instance removal much cheaper. We no longer need to loop and scan multiple arrays to find our instance to rename.
Added a bit more commenting around the code.
#preflight 6438851d9566b61450a1c45e

[CL 25039201 by jeremy moore in ue5-main branch]
2023-04-14 09:07:04 -04:00
jeremy moore
54f43f2240 Add MinLod option to ISMPool components.
#preflight 64349821b306e98c634b5019

[CL 24987424 by jeremy moore in ue5-main branch]
2023-04-10 23:19:28 -04:00
jeremy moore
e861e8645f Add support for ISMPool reverse culling flag. This allows us to potentially create two ISM components for left and right handedness if needed.
Add free list for ISMPool ISM component slots so that we can recycle them when the number of instances for a component becomes zero.
#preflight 642f0942427eda562650ef0b

[CL 24957562 by jeremy moore in ue5-main branch]
2023-04-06 17:29:18 -04:00
jeremy moore
5a74598a34 Better parameterization of ISM pool components.
Still work to do for recycling components that are empty.
#preflight 642b52164d26bcd1eb357be2

[CL 24906566 by jeremy moore in ue5-main branch]
2023-04-03 23:33:01 -04:00
kenzo terelst
b11faa9d8b Make sure delegates are removed on component destruction and move delegate ownership to component as well
#rb Jeremy.Moore
#preflight 641b401aa6092dfb8dbbafdd
#rnx

[CL 24756440 by kenzo terelst in ue5-main branch]
2023-03-22 19:44:46 -04:00
cedric caillaud
c5a77ae596 ISMPool, fix bug where processing batched transform were shifted by 1 after index 0
#rb kenzo.terelst
#preflight none

[CL 24750254 by cedric caillaud in ue5-main branch]
2023-03-22 13:08:11 -04:00
kenzo terelst
857a7c0207 - Use ISMComponent events on instance removed and index reallocated in the ISMPool to handle both ISM & HISM reordering on remove instances (Remove vs SwapRemove differences)
- Re-enable HISM by default for GeometryCollection proxy and leaf rendering

#rnx
#rb Cedric.Caillaud
#preflight 6419ff1e42618c85c40b6975

[CL 24740869 by kenzo terelst in ue5-main branch]
2023-03-21 17:54:35 -04:00
jeremy moore
4af0cb0770 Added ISM pool debug component.
Currently allows ISM selection and some debug bounds/stats.
#preflight 64090c8ca92b27de3c553c5c

[CL 24571870 by jeremy moore in ue5-main branch]
2023-03-09 00:00:20 -05:00
jeremy moore
644ac38dc2 GeometryCollection object can store custom instance data to pass to instances spawned in ISM pools.
Also add a per component custom data which, if present, is added to all ISM pool instances that the component generates.
#preflight 6409444bcf5fe1e28c0e065c

[CL 24571716 by jeremy moore in ue5-main branch]
2023-03-08 23:38:52 -05:00
jeremy moore
34bb7d78c3 Use AddInstances() from ISM Pool.
This gives a single HISM rebuild event instead of one for each instance added.
#preflight 6405fb733206d45d200c007a

[CL 24528554 by jeremy moore in ue5-main branch]
2023-03-06 15:17:02 -05:00