Search Unity

Question frustum culling and update

Discussion in 'General Graphics' started by Zoulz, Dec 15, 2022.

  1. Zoulz

    Zoulz

    Joined:
    Mar 14, 2014
    Posts:
    13
    Hey there, so apparently unity does frustum culling automatically not rendering objects that are outside the view frustum. But do those objects still trigger update etc? If so, is there some way to determine if an object is being culled or not?
     
  2. c0d3_m0nk3y

    c0d3_m0nk3y

    Joined:
    Oct 21, 2021
    Posts:
    666
    Yes, objects still get updates even when culled. Some components have attributes where you can configure how they should behave when culled (for example, Animator.cullingMode or ParticleSystem.cullingMode).

    You can query visibility via Renderer.isVisible. There are also OnBecameVisible and OnBecameInvisible callbacks which you can use to enable/disable the object in order to pause the update calls when culled.

    Additionally, you can use the CullingGroup API to get culling data for bounding spheres.
     
    Last edited: Dec 15, 2022
    Zoulz likes this.
  3. Zoulz

    Zoulz

    Joined:
    Mar 14, 2014
    Posts:
    13
    Awesome thanks so much! :)
     
    c0d3_m0nk3y likes this.