There’s a part of our game where we spawn about 1000 simple actors – basically just vertically stretched cubes with a simple material on them.
When we do this, our frame rate goes from 120 fps down to 27.
We used the Very Sleepy profiler to examine the performance, and it says the rendering thread is spending pretty much all of its time inside FTextureLayout3D::AddSurfaceInner.
Here’s what the profiler tells us, further confirming that the performance issue is coming from the indirect lighting cache.
What can we do about this? Clearly, 1000 super-simple actors shouldn’t be slowing the game down this much.
Is there a good way for us to somehow turn off the indirect lighting, given that these are basically just player feedback indicators?
Or should we be building and rendering a custom mesh for this?
EDIT: Here’s an example. Notice how with just this set of objects, we’re down to 8 frames per second.
What’s more worrisome is that after we spawn all these little indicator actors for our overlay modes, they incur what seems to be a permanent performance cost. Even though we hide them when you’re not in an overlay mode by setting their ‘Visible’ property to false, they still hurt the frame rate by the same amount.