Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Occlusion Culling way less performance vs disabling objects

Discussion in 'Editor & General Support' started by sprawww, Feb 19, 2016.

  1. sprawww

    sprawww

    Joined:
    Dec 5, 2013
    Posts:
    17
    Hey,

    first of all let me clarify that OC seems to be doing its job in my scene. As in, when I bake the scene and turn it on, all relevant stats go down, while the FPS goes up.

    Recently I noticed however that disabling all other parts of the level yields in a much higher performance gain.

    As a small test, I setup 10 similar looking, adjacent rooms and placed the camera in one of them. Each room had 1 or more mixed/realtime lights, all objects with no exception were marked as static. These were the FPS I was getting for each case:

    No OC, all objects active: 35 FPS

    OC on, all objects active: 41 FPS

    OC off/on, all objects but the current room + adjacent rooms inactive: 71 FPS

    Now this was for a relatively small test scene, in one of my actual scenes, this made a difference of 100 FPS on my development rig.

    As I understand it, all culled objects still execute their scripts, which is understandable and a desired behaviour, but the test scene contains no disabled scripts. Removing the lights before running the test results in a smaller gain, however the gain is still very visible.

    OC being less performant than manual disabling was always kind of obvious to me, but I never realized how big the difference actually is.

    So right now I'm pretty unsure about what to do, would it be better to manually disable the other parts of the level as the player walks around? I'm not even sure if disabling/enabling hundreds of objects on the fly would be wise, anyone tested that yet? Or did I setup OC wrong somehow?

    Deffered Camera, Unity 5.3.2, DX11, Windows 7
     
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    There's not much information here really, just a story about how hiding objects gave you framerate back. You need to dig deeply into why that's happening, and if you think it's a bug, please report it so it can be fixed.
     
  3. sprawww

    sprawww

    Joined:
    Dec 5, 2013
    Posts:
    17
    I don't think it's a bug, otherwise I would have submitted a report, don't you ever do that?

    I'm asking for pointers as I don't really know what's going on. I also apologize for the apparent lack of information.