I use WorldToViewportPoint to disable some function calls for my AI when they are about 50% away from the screen, but it seems slower to check Renderer.isVisible for each object before WorldToViewportPoint than it does to just do WorldToViewportPoint on every object.
I assumed that Renderer.isVisible would be a quicker way to check if something is offscreen than using WorldToViewportPoint and some math but my tests in Editor with about 30 objects doesn’t match my assumptions.
Looking up Renderer.isVisible seems to show that it uses CalculateFrustumPlanes and I guess that is slower than WorldToViewportPoint? So even if I had a million objects to check, isVisible wont be any help?
Is there a faster way to detect on onscreen object?
my game is 2D, Unity 4, multiple cameras sometimes.