rdInst Tutorial 45 – Populating only within a radius of the player
Last Edited: 4th October 2024
Tutorial created using rdInst version 1.50
Note: This Tutorial uses the preview version of UE5.5 and is subject to change.
UE5.5 and PCG give us the ability to populate large expansive worlds quickly and with extreme detail.
GPU Instancing is a great step into the Compute Shaders, but has a draw back in that they’re not interactable – a lot of the speed comes from this fact which isn’t a problem for objects in the distance. Having a very fast way to spawn complex detailed environments gives a whole new way of keeping framerates up while delivering the content the gamer wants.
rdInst 1.50 brings in a new feature called “Local Only” populating. It populates a sphere around the player, moving further objects into view and recycling where possible for speed. These support instanced static meshes for now, but will also support actors in a future update. The Instances can have proxies attached, so when they get even closer they can swap to fully interactive actors.
As there are only a small number of objects being swapped at any one time (just around the perimeter) this is a fast operation. (Note: careful consideration to VSMs and invalidation should be used to minimize overhead)
Combine this with an addition to the PCG instances materials to hide within the player radius – and you have a system which seamlessly goes from GPU Instancing to CPU Instancing to Fully Interactive Actor – all done in an optimal way.
This tutorial uses some of the PCG population tools and assemblies to create a level which is spawned using the GPU instancing. The PCG graph then filters to a selection of the objects used that we want to be interactable and use the rdInst custom node to populate a SpawnStuffActor using Local Render mode.
Step 1. Migrate the PCG maps from the Electric Dreams project to your own project.
The first thing to do is migrate the assets we’re going to use into a new project (or existing one, doesn’t matter).
Open the Electric Dreams project (available from the Launcher at this time, Fab soon) and navigate to the “Levels/PCG/Breakdown_Levels” folder. Select the files and right-click then Migrate (from the Asset Actions menu) – choose the Content folder of your new project as the destination. This may take a while as there are a lot of assets (make sure you have disk space too).