Custom Occlusion Blutility Function to Delete Unseen Static Meshes Actors In Level

Greetings Everyone.

I have a case for a Custom Occlusion Blutility Function to Delete Unseen Static Meshes Actors In Level.

Before embarking down the rabbit hole of designing one, I thought I check with the community to see 1) if there’s another way to do it in UnrealEditor; 2) if there’s a pre-existing BP function I’m overlooking; 3) or if another Developer has one available they’re willing to share.

The case is straight forward. I’m creating large piles of static meshes that are severely impacting my performance. I could improve performance by removing the Unseen Static Meshes Actors in the piles.

Im open to any suggestions. As a token of my appreciation, here’s a stock photo of cute baby yorki:

If a mesh in unseen, it’s not rendered anyway, so you might be barking up the wrong tree… :wink:

Maybe thin out your piles a bit.

That depends on distance. I can see the culling in wireframe mode. They are being rendered when up close.

Not distance culling. Also, if no part of a mesh is in the frustum, as far as I know, it shouldn’t be drawn.

But you only need a spec…

I appreciate the replies. I’ve manually deleted Actors and performance increases. The unseen actors are being drawn when up close and I want to automate the deletion of these actors. I’m open to any recommendations on another way to do it in UnrealEditor; 2) if there’s a pre-existing BP function I’m overlooking; 3) or if another Developer has one available they’re willing to share.

Yes, sorry, I can’t say anything definitive. Maybe a way of making the piles without leaving unseen actors at the center, or HISMs?

1 Like

Hi,

I can see the culling in wireframe mode. They are being rendered when up close.

You don’t have any culling in wireframe mode…

If you want to see what is rendered, use FreezeRendering Command.

As for removing meshes inside the piles that cannot be seen, might be easier to do it by hand and then have a couple of different piles as blueprints and use those. If you want to do it automatically you could use linetraces with complex collision and see what they don’t hit. So do a lot of linetraces from a lot of different positions around the pile.

1 Like

Thanks Again. Great idea to start removing from the center, since those are actors spawned and positioned firstly.

Perhaps is was not wireframe mode. I was performing a bazillion tests. Thank you for the tip on the ‘FreezeRendering’ Command. I’ll start designing the function using Tracing on the exterior of the pile, ill call this the Visibility Scan.

Visibility Scan - Tracing on the exterior of the pile.
When a Pile is generated, Actors are stored in a Pile List, thus the Visibility Scan adds Actors hit to a Seen List. When Visibility Scan is completed, we iterate through the Pile List to Find the Actor in the Seen List. If Actor is Not Found in Seen List, delete Actor.

  1. Use independent Volume to define cubic space to perform scan on 6 sides: front, back, top, bottom, left, right.
  2. For each side, perform a incremental line trace in grid pattern from Top-Left to Bottom-Right. Actors hit during the scan are stored in Seen List.

Nearly Complete with the Visibility Scan

OSMIUM Occlusion Utility- Occlusion Blutility Function to Delete Unseen Static Meshes Actors In Level improving Performance.

OSMIUM Occlusion Utility - FREE Download