3) I was probably wrong. I said that it’s nanite-only because from a fast look at the code it seems that the hierarchical data needs cooked data and it is built only if DoesTargetPlatformSupportNanite(TargetPlatform) is true. So, not really nanite-only but maybe nanite-support-only.
You are right, the hierarchy data is only produced on Nanite platforms at the moment and that is because before the CPU-side culling the only user is the GPU instance hierarchy. Now, it may make sense to do so but this has not really been tested yet. The runtime side excludes Nanite primitives (since they are GPU-culled), which is what I thought you were referring to. So, yes, it is indeed a small change to cook the data for all platforms.
I’d be curious to hear your experience with this if you try it more, since we don’t have a lot of internal data yet.
There’s been a few changes/fixes since 5.8 - notably if you have greatly varying instance scale it will not select LODs conservatively leading to missing data (this went in a week or so ago). But I’m also not 100% sure what state exactly it shipped in 5.8 TBH.
I’m curious what problem you are wanting to solve with this? And also what platforms are you targeting for this?
The feature was added mainly for mobile because the mobile GPU-Scene implementation has to copy a lot of data for each instance and the conservative allocation sizes blow up. For desktop platforms it’s just an int32 per instance so generally ok to throw at the GPU. Except, also local lights can be pretty awful when just brute-forcing instances, so there’s that angle too.
3) to hierarchical cull instances during rvt writing
this seems to work, looking at viewport and instance count. I didn’t do any gpu capture, hoping this is a mature feature missing only some minor changes.
We had an HISM with 20K instances mesh: it was ok to render that in the main camera (even without nanite). When we tried to render those only to RVT (since they were similar to mesh decals), fps collapsed. Each RVT tile was rendering all those 20K instances since the AABB was big as the world. So we has to split the HISM in smaller HISMs, so that the rvt culling could skip more HISMs AABBs. I don’t recall the exact timings, but we went from unshippable to 1 or 2 msecs tops.
Another use case may be CSM culling. We expect low cpu time when camera and sun don’t move. Now GetDynamicMeshElements tanks cpu when HISM are CastShadow. We had to implement a castshadow foliage splitter, to split the foliage hism in a low-instance-count + nearcamera castshadow foliage hism and a high-instance-count + farcamera no-castshadow hism.
Legacy streaming may use that system too. ISM takes the aabb for mipmap selection, forcing highest mipmap even for very far elements (consider 4 instances at the 4 corners of the world, with a camera at the origin). Considering each instance AABB may be overkill. Considering hierarchical aabb cells may be probably manageable.
I think that a generic API would be great for game developers, so that we can do volume queries more efficiently