Surface cache statistics

We have noticed that the default settings for number of surface cache cards to update per frame was quite costly and tried lowering that. Of course that leads to much slower updates in scene lighting in general which led us down the path of optimising the amount of cards. Is there any guidance or stats available for the number of cards in the scene, or the number of cards pending updates? The default setting is 12 cards, which I assume is a good default setting. Is it common practice/recommended to adjust this number down as low as possible on a per asset basis?

Hi Tor,

Yes, we still recommend the default of 12 cards per mesh, and tweaking this number will ultimately come down to experimentation on your end. Can you share some numbers of the performance issues you are seeing? If you see slow update rates of the scene lighting once you decrease the number of surface cards per mesh, have you tried increasing r.LumenScene.DirectLighting.MaxLightsPerTile and r.LumenScene.Radiosity.Update Factor cvars in turn to improve the light propagation?

In our game we have a pretty large amount of modular meshes, so updating the surface cache took something like 7ms. And a lot of those cards are discarded as well as the are missed and inside geo etc. We changed the r.LumenScene.SurfaceCache.CardCapturesPerFrame to be much lower, but of course that means the update rate is much slower. We will probably need to reduce the amount of cards per mesh drastically where we can, but ideally there would be some kind of metric for us to measure against instead of just pulling things down and make guesstimates. Is there some statistic we can expose for this?

Okay, that makes sense. Unfortunately, we do not have any metrics that we can share, as the surface card placement is heavily content-dependent. Meshes that are more regular, such as walls, will naturally get better card coverage, but irregular meshes might need a lot more manual fine-tuning. I know that this will come with a lot of tedious labor, but that is currently our method as well.

It sounds like you already tried some version of this, but perhaps cross-referencing the card placement visualization while tweaking the max lumen cards setting will yield better results. In the mesh editor, you can turn on r.Lumen.Visualize.CardPlacement to visualize the card placement on the individual mesh asset.

This is not an ideal solution, but let me know if you have any further questions about this process.