Reduce cost on rendergraphexecute


How can I reduce the time on UpdateAllPeimitveSceneInfos to optimize my game’s performance?

This encapsulates the gathering of data for changed/added primitives. To reduce, limit what you spawn/change per frame.

Time slice your spawned mesh code to distribute over several frames. Reduce or eliminate moving actors. Set cull distances.

Using ISM/HISMs, generating and using HLODs, and combining static meshes into one are also helpful for this.

im using nanite, does it help?

It’s neutral. Nanite is about rasterizing, the prims still follow the same path.

the source is with Niagara particles

Makes sense… I would be interested in if its using mesh particles, how many emitters are spawning. If it’s once in the beginning you might be able to hide the hitch. Look at least setting up Niagara pooling to reduce churn. It’s worth reading up on Niagara optimization:

3-5