Don’t Let Offscreen Objects Ruin Your Performance – Unity CullingGroup API – General and Gameplay Programming – Tutorials
Check the original blog post at The Gamedev Guru: Don’t Let Offscreen Objects Ruin Your Performance – Unity CullingGroup API
Learn how to make your expensive scripts cost nothing while they are offscreen.
Table of Content
Offwhat GameObject?
First off: what is an offscreen object?
An object is offscreen when you cannot see it from your camera’s perspective. This may happen because your object is “behind” your camera (therefore culled by frustrum) or behind walls/other occluders (occlusion culling).
So if an object is offscreen and we cannot see it, we don’t have to dedicate expensive computational resources to it right?
Wrong. That’s what I thought when I was a kid. Not anymore.
The Performance Cost(s) of Offscreen Objects
Here are some of the hardware costs you are paying for offscreen objects:
- The culling price: is an object offscreen at all? Unity determines this by checking its visibility through