Frustum Culling
Increase the performance of your game by completely disabling game objects based on the frustum or distance of the camera.
WHAT IS FRUSTUM CULLING?
Frustum Culling can improve both the framerate and the performance of your game by disabling game objects completely when they're not in view (or distance) of the camera. Stop events, scripts, animations, sounds, basically any and all components on an object when it’s not in view and then re-enable when back in view by enabling the object itself. It fully supports 3D (first & third person) as well as 2D and 2.5D games.
WHY USE FRUSTUM CULLING?
Sometimes, depending on your game, you may have CPU intensive game objects that are affecting the performance of your game even when they aren’t needed. To remedy this, we can disable these game objects whenever they are out of view (or distance) and then re-enable them when back in view. A puzzle/interactable object that is making heavy calculations and validations every frame, for example, may not need to run when the player isn't looking. Disabling these out of view game objects can sometimes improve the framerate of your game dramatically.
SUPPORTED VIEWS
Fully supports 3D (first & third person camera) as well as 2D including 2.5D camera view.
RENDERING PIPELINES
This package works on all rendering pipelines (Built-in, URP & HDRP) but the demos are made for Built-in and URP.
DYNAMIC OBJECTS
Frustum Culling works on dynamic game objects. Even those generated at runtime.
DISTANCE CULLING
You can also, optionally, disable game objects based on the distance of the camera, as well as the view.
HOW IS THIS DIFFERENT FROM UNITY'S SOLUTION?
Unity performs Frustum Culling on static objects by default under Occlusion Culling. You need a custom solution, however, to completely disable the game object as Unity's solution merely disables the mesh renderer. Using our tool, you can disable a game object in its entirety and thus save even more on performance than standard Unity solutions would allow. On the other hand, it is recommended to not use it on one’s entire world.
DOCUMENTATION
The package comes with documentation and fully commented source code as well as a demo for Built-in and URP to help give you a running start.