Question about Nanite transient buffers and r.Nanite.RasterIndirectionMultiplier

Hello

After an update from 5.4 to 5.6, we encounter some memory issues (OOM on console).

During our profiling and by comparing rhi.DumpResourceMemory between 5.4 and 5.6 we saw that some buffers are present in greater quantities in 5.6.

We identify that a part of them come form the activation of NaniteTesselation, which we disabled (useless for use), but even after that we continue to have more buffers on 5.6 than 5.4.

* Nanite.RasterBinData : 7 vs 5

* Nanite.VisibleClustersSWHW : 4 vs 3

* Nanite.MainAndPostCandidateClustersBuffer : 4 vs 3

We found 5 and 3 calls in DeferredShading, VirtualShadowmap and Lumen, which explain 5 RasterBinData and 3 VisibleClustersSWHW + MainAndPostCandidateClustersBuffer, but not the additional buffer instances.

During the inverstigation for the additional ones, I discoreved r.Nanite.RasterIndirectionMultiplier.

An interenting fact is that, with a value of 1 I have the same value as 5.4.

So my first question is could you give us more information on those buffers and maybe where they could come from, or at least we can check ?

My second question is about r.Nanite.RasterIndirectionMultiplier itself.

It’s like it can be a good memory optimization in our case, but I have some difficulty to evaluating its possible impact on render and how to find the appropriate value for us.

From what I understand, its current value allows to handle multiple materials per cluster (3 by default).

With the “Material Count” Nanite visualization, I saw that we have few object that can have 2 materials on the same cluster, but didn’t see the effect on them by modifying the cvar.

Could you give us more information on it to know if I misunderstood it and how we can indentfy a more relevant value for us ?

Thanks

-Quentin

This multiplier is somewhat arbitrary. This multiplier is used to determine the final size of the Nanite.RasterBinData buffer. The final size of this buffer is r.Nanite.RasterIndirectionMultiplier * r.Nanite.MaxVisibleClusters. This buffer is essentially a list of visible triangle range batches for the renderer to rasterize. If the materials assigned to a cluster allow for fast path rasterization, then there should be 1 batch per material section per cluster. If the materials assigned to each cluster are all rasterizer fast path (e.g. no World Position Offset, no more than 3 materials per cluster), then this should allow for r.Nanite.MaxVisibleClusters clusters, with up to r.Nanite.RasterIndirectionMultiplier materials on screen at a time before geometry starts disappearing (due to overflowing the buffer). However, you’re probably unlikely to have multiple materials assigned to an individual cluster very often. So, perhaps setting this to 3 by default is a bit overkill. There are also various other, more complicated, factors that can affect the final number of RasterBinData entries (these estimates kind of go out the window when you start adding WPO into the mix).

Essentially, as long as you’re not getting geometry disappearing, or getting the following warning in editor, then this buffer is set big enough for your use case. You can adjust both these CVars to fit your game

[Image Removed]

Let me know if anything is still unclear to you.

Regards,

Lance Chaney

Hi Lance

Yes it’s clearer, thank you.

With your explanation, we will need some tests to convefirm RasterIndirectionMultiplier to 1, but it seems safe.

Thanks

- Quentin