Skip to main content

Unreal Engine - Scene optimization tips

General rules

First and foremost, treat you render time and performance as a budget. You only have so much performance on your PC. You can only spend it once, just like money. Some asset van be very cheep in performance, to make budget for another expensive asset.

Materials

Make sure you use material instances. Every material adds render time. Instances don't add render time. It is a good practice to have one or a few master materials and instance those for every new material needed.

Remember that some nodes inside your material can be slow. The noise nodes for instance can be expensive.

Instancing

When an asset, mesh or material is instanced it only takes a little bit from your budget. Every unique mesh needs to be rendered on its own render pass. When a mesh is instanced, it only costs one pass to render all instances of that mesh.

For example: When you want to fill a forest with trees, it is more performant to instance one or two trees, than to make 100 unique trees. Scaling, rotating and materials doesn't matter. 

One of the best ways to instance meshes is to use PCG. Using PCG you can write rules on how and where meshes should be instanced. You can always update these rules, so its easy to iterate.

GPU usage

Most of unreal's renderpower comes from your GPU. That's why it is important to keep monitoring your gpu usage. You can do this using the "ProfileGPU" command in the command line. This will show you the GPU profiler. In this window you can see how long your GPU takes to do a certain part of the rendering. A lot of times the Shadowdepth will take up a lot of miliseconds. But it can also be other things like Materials or blueprints.