rdInst Tutorial 40 – Auto-Instancing with rdInst

Version 1.40 of rdInst introduces a new tool which makes optimizing your levels extremely easy. The idea was suggested by RomanK and DannyArt at GOODFUNCORP.

This system works with:

  • Static Mesh Actors
  • Blueprints with:
    • Static Mesh Components
    • Child Actors with StaticMesh Actors
    • Instanced StaticMesh Components (and Hierarchical)
    • Prefabs (not rdActor based, they’re faster as they are)
    • Packed Level Actors
    • Foliage and PCG Volumes (the difference may be negligible)

If your level is using World Partition with tile streaming and HLODs, and you’re using the instance-able assets dispersed throughout the level, it can be more optimal to have Spatial Loading turned off for those assets, not include them with your HLOD, and have a good culling distance set. This can often remove the need for an HLOD for large amounts of tiles, reducing the VRAM used, less textures, less drawcalls, less disk footprint, less streaming and less work spent creating HLODs.

All you need to do to activate auto-instancing in rdInst is tick one box.

This type of instancing works with all types of StaticMeshes, whether they have unique materials or properties, or have negatively scaled meshes. It works alongside any system including Epics. Support for UE 4.27 up included.

The system works at runtime, so you edit your levels as normal – and when you play or preview the conversion is done. It’s a quick process.

If you have Culling Distance volumes in your level, their values are calculated and applied to the instances.

This tutorial uses Houses from Prophaus Residential Houses collection (volume 2).


Step 1. Create a project and add the Residential Houses collection

Create a new level and add some of the Residential House Packed Level Actors to the level – the more, the better.

For good measure, add a few Blueprint versions as well.


Step 2. Play it with Stat FPS and Stat Unit to check drawcalls and FPS

Now play the level and run the console commands “stat fps” and “stat unit” to display the basic performance information.

Note the FPS time, Draws and Primitives. Running on my hardware in preview mode it gets 96.44 FPS from 1650 Draw Calls and 288,900 Primitives.


Step 3. Enable Auto-Instancing in rdInst Setup Actor

Now just select the “rdInst Settings” actor in the outliner, and in the details panel tick the “Enable Auto Instancing” tickbox.


Step 4. Done.

It’s as simple as that, rdInst does all the rest. Just play the level again now and note the difference – 120FPS from 384 DrawCalls and 7310 Primitives.


There are also other ways you can control the Auto-Instancing.

If you tick the “Auto from Tags” checkbox, only actors that have the tag “rdAutoInstance” will be converted to instances.

You can also limit the conversion to Mesh Actors, and/or Blueprints with StaticMeshComponents, ChildActors with StaticMeshActors, PackedLevelActors or Foliage/PCG Volumes.

Add the tag “rdDontAutoInstance” to any actors you don’t want converted.