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:
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.
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.
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.
Use independent Volume to define cubic space to perform scan on 6 sides: front, back, top, bottom, left, right.
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.