Nanite Performance Options

[Image Removed]

Hey guys, here’s more or less how our frame shakes out at the current moment. We have some post process things and fog stuff we need to adjust in scalability, but I’d like to know what our options are for adjusting nanite perf on low end. There are some flags we can adjust, but it’s unclear where we’ll find best bang for buck. Let me know.

Hi,

there are quite a few CVars that more or less control the performance of Nanite rendering. Below is a list of the most relevant ones together with some links to provide further context:

> r.Nanite.MaxPixelsPerEdge (default 1): The triangle edge length that the Nanite runtime targets, measured in pixels (Higher = less geometry), probably the CVar which has the most impact on performance.

[Content removed]

> r.Nanite.MinPixelsPerEdgeHW (default 32) The triangle edge length in pixels at which Nanite starts using the hardware rasterizer.

[Content removed]

[Content removed]

[Content removed]

> r.Nanite.ViewMeshLODBias.Offset (default 0) LOD offset to apply for rasterized Nanite meshes for the main viewport when using TSR (Higher bias = less geometry)

[Content removed]

> r.Nanite.PrimaryRaster.PixelsPerEdgeScaling (default 30) Lower limit percentage to scale the Nanite primary raster MaxPixelsPerEdge value when over budget.

[Content removed]

> r.Nanite.PrimaryRaster.TimeBudgetMs (default 0) Frame’s time budget for Nanite primary raster in milliseconds.

[Content removed]

[Content removed]

> r.Nanite.ShadeBinningMode (default 0) 0: Auto 1: Force to Pixel Mode 2: Force to Quad Mode

https://dev.epicgames.com/community/learning/knowledge-base/qBx7/unreal-engine-fortnite-nanite-compute-material-optimizations#debuggingvisualizations

As evaluation in 1x1 mode guarantees no quad overdraw, it is the higher performance path. (https://dev.epicgames.com/community/learning/knowledge-base/qBx7/unreal-engine-fortnite-nanite-compute-material-optimizations#nanitepixelshadingfastpath)

> r.Nanite.ShadowRaster.PixelsPerEdgeScaling (default 100) Lower limit percentage to scale the Nanite shadow raster MaxPixelsPerEdge value when over budget.

> r.Nanite.ShadowRaster.TimeBudgetMs (default 0) Frame’s time budget for Nanite shadow raster in milliseconds.

[Content removed]

For Nanite tessellation:

> r.Nanite.DicingRate (default 2) Size of the micropolygons that Nanite tessellation will dice to, measured in pixels.

[Content removed]

[Content removed]

Let me know if that helps.

Sam

No worries. I’ll close the ticket, but please reopen it if you have further questions.

Best,

Sam

Awesome, thanks Sam!

r.Nanite.ShadowRaster.PixelsPerEdgeScaling doesn’t actually seem to be used by the engine. There’s a function to wrap access to it, GetDynamicNaniteScalingShadowSettings(), and then it’s initialized to, DynamicRenderScaling::FBudget GDynamicNaniteScalingShadow( TEXT(“DynamicNaniteScalingShadow”), &GetDynamicNaniteScalingShadowSettings);

But then nobody ever actually uses GDynamicNaniteScalingShadow.

Where as - GDynamicNaniteScalingPrimary, gets used like this: DynamicRenderScaling::FRDGScope DynamicScalingScope(GraphBuilder, GDynamicNaniteScalingPrimary);

Hi,

Good catch and apologies for that. The CVar was introduced with this commit, along with a few others to control Nanite’s performance, but apparently its implementation wasn’t finished (I see now that the commit is also flagged as WIP).

Thanks,

Sam