Search Unity

Question How to use Occlusion Culling for a city builder?

Discussion in 'General Graphics' started by AstrooLabe, Mar 21, 2021.

  1. AstrooLabe

    AstrooLabe

    Joined:
    Jan 3, 2019
    Posts:
    14
    Hi there,

    So I'm working on a little city builder to gain skills on Unity and other things. Right now I'm facing a performance issue as the latest asset I added has too much tris (12,300 in blender).

    I'm working on it actually but I figured that I could also improve performances by using occlusion culling. However, default Unity OC works with baked data which is not really compatible with a city builder.

    Is there any way to make it works with dynamic environnements?
     
  2. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,748
  3. AstrooLabe

    AstrooLabe

    Joined:
    Jan 3, 2019
    Posts:
    14
    And what? Thx but I already did.

    Occlusion culling is already enabled on my main camera, my assets renderers have Dynamic occlusion enabled but the scene is empty on a new game so no bake datas nor Occluder.
     
  4. AstrooLabe

    AstrooLabe

    Joined:
    Jan 3, 2019
    Posts:
    14
    To be more precise, what I need is a way to make my assets act as occluders even if it wasn't in the scene when the game is loaded
     
    Last edited: Mar 21, 2021
  5. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    You cannot. Unity's occlusion culling solution needs to be baked at edit time, you cannot add occluders at run time.

    Also, city builders often use overhead views which don't benefit from occlusion culling. What do your game look like?
     
  6. AstrooLabe

    AstrooLabe

    Joined:
    Jan 3, 2019
    Posts:
    14
    Free camera, overhead view... so as you say, it will probably not benefit from occlusion culling. So I guess, I'll have to make with fustrum culling only and simplify my models as much as I can
     
    warthos3399 likes this.