Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Occlusion Culling brings down fps

Discussion in 'General Graphics' started by Moddwyn, Dec 28, 2017.

  1. Moddwyn

    Moddwyn

    Joined:
    Jan 27, 2016
    Posts:
    49
    When I have occlusion culling in my game, I get an fps less than 90 fps but when I dont have any, I get fps above 100. I am using default bake settings and realtime lighting. Why is this happening? Is it because Im using real time lighting instead of baked lighting?
     
  2. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    We probably should ban fps as a measurement forum wide.
     
    c0d3_m0nk3y, apkdev, arkano22 and 3 others like this.
  3. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,433
    If we also ban 'AAA', then I'm all for it.

    You should use the profiler and activate deep profile to get a better picture of what takes the most miliseconds of rendering a frame and compare what changed between your two settings. I wouldn't be surprised if culling was slower. The question is whether you're cpu or gpu limited and if there even is enough stuff that makes sense to cull.
     
    hippocoder likes this.
  4. eovento

    eovento

    Joined:
    Feb 22, 2018
    Posts:
    38
    First we have to ban those who take a time to complain and add zero help to someone's problem.

    I'm also having this... and taking all light out, for the sake of experimenting, didn't seem to affect.
    With Occlusion Culling it cuts the amount of tris, verts and batches, but my FPS were also cut by 25%! haha
    Actually, there wasn't a single time I've got performance boost from Occlusion Culling. I don't understand the fuss about it, and everywhere I research, forums and youtube, they are always (90% of the time) talking about Frustum Culling instead, without knowing it).

    As it's been 3 years since you posted, did you manage to make Occlusion Culling to work in your favor?

    For performance, in my projects, what have been saving me is LODs - not forgetting to set all LOD meshes as Static, so static batching can work.

    Cheers!
     
  5. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    506
    Occlusion culling never increased my fps too! not even 1 frames. So why should we use this?
     
  6. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,120
    Umbra occlusion culling (the ones unity uses) is bad. The CPU overhead, AND it's efficiency at culling are both bad.
    If you want a real occlusion culling solution, use Perfect Culling in the asset store. It's runtime costs are very low, no matter how big your world is. It's still static though so you need to bake it. It also culls way more compared to umbra, so even more runtime performance gains.

    - Not affiliated, but I've suggested this asset many times. It's genuinely embarrassing that unity doesn't have a proper occlusion culling feature, even a static one. In 2022.

    - I've heard that Umbra nowadays is good, but unity is using an old version. Not sure if this is correct though.
     
  7. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It's because on weaker hardware, Umbra's work might take longer than just doing the work.

    It also gets abused by people who don't correctly define occluder vs occludee, and they don't have the experience to understand what they are doing wrong.

    It shines when you're not asking it to occlude a million things and don't have too many small occluders. Occluders should usually be static big shapes, not thousands of tiny things. Also, you don't want it to occlude a whole bunch of small low poly objects either, because those shouldn't even be rendered separately. They should be combined beforehand, or using instanced indirect (GPU) to decide to draw or not.

    On mobile though, specially if the budget is already eaten up by draw calls, audio, GC, physics and all sorts of stuff, I'd recommend people try their own area-based occlusion. Turning things on and off based on primitive zone like triggers is often much better performance for slow hardware.
     
  8. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,791
    Use this solution instead to reduce poly count... It works without runtime cost even on the most low-end platforms . You can use Fog effect to hide the switch visible / invisible problem
     
    Crossway likes this.
  9. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    225
    I assume it can be used on PC projects?
     
  10. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,393
    It can be used on any project. The culling does add CPU overhead, so dependant on the scene performance changes.
    I've seen great performance benefits with it, but also performance downgrades.
    Manual culling or a solution from the asset store (until the new DOTS culling hits) is probably best for performance
     
  11. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,660
    You can get absolutely massive performance wins using occlusion culling (I have in the past), but you must learn to use it.

    It will only have any positive effect if you're bound by either draw calls or overdraw. You can only know whether this is the case by profiling (and using scene debug views), otherwise using occlusion culling will cost you more than it saves.
     
    Last edited: Aug 22, 2023
    DevDunk likes this.
  12. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    225
    Umbra starts from a good principle, but it prevented me from compiling my project. I wrote to the author who never answered me
     
  13. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,660
    Umbra is used on a ton of engines and non-Unity games, it's not exclusive to Unity so not sure how they could help you regarding compiling a Unity game.
     
  14. ARealiti

    ARealiti

    Joined:
    Oct 4, 2013
    Posts:
    132
    As alluded to by other posters, occlusion can be slow when occluding lots of little objects. However, it makes sense to have a lot of little objects for better Frustrum Culling and LOD/culling. So catch 22.

    This is one of the areas of Unity I did my own to maximize the benefits of Frustrum Culling and LOD/Culling with my own Occlusion Culling.
     
    Last edited: Sep 23, 2023