Search Unity

Do game object static flags Occluder Static and Occludee Static affect frustum culling as well?

Discussion in 'Scripting' started by Gooren, Nov 30, 2018.

  1. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    332
    I am not sure whether game object static flags Occluder Static and Occludee Static affect frustum culling as well as they obviously affect the occlusion culling.
    I would love to know however, because culling hits the performance hard in our game. And we are not using the occlusion culling at all. So I need to know if these flags or anything else for that matter can beneficially affect the frustum culling performance in our game.

    Thanks in advance :)
     
  2. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    There is no way to disable frustum culling in Unity.

    I'm very skeptical that frustum culling would be hitting your performance so hard.. if it is, I can't imagine you'll be able to do very much scripting at all without hitting your performance in a bad way.

    When using the profiler, keep in mind it's ok for an operation to use a large percent of your CPU/GPU time, so long as the total CPU/GPU time per frame is not too large.
     
  3. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    332
    I understand - but the problem is the culling takes 30% CPU time in our game, same as rendering. While the total CPU usage is 100%.
    The remaining 40% is taken by AI, Physics, custom scripts etc.
    Therefore I was hoping that tweaking Occluder Static and Occludee Static game object fields just might improve our frustum culling performance a bit.
    Maybe the internal spatial partitioning algorithm Unity is using for the frustum culling could benefit from it as well as occlusion culling does?

    I don't know.
     
    Last edited: Nov 30, 2018
  4. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    Unfortunately I've verified in the past that there is no way to disable frustum culling.. there is only a way to "trick" objects that should be culled into not being culled by modifying their "Bounds".

    What is the actual time (in ms) frustum culling is taking? Approx. how many objects and cameras are in your scene?
     
  5. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    Here's a quote I've received from a very knowledgeable graphics programmer in a different thread:

    https://forum.unity.com/threads/is-...ertex-animation-in-shade.576562/#post-3842977
     
    Gooren likes this.
  6. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    332
    Disabling frustum culling would kill our game's performance for sure. I don't want to disable it, our game absolutely does benefit from it.
    The thing I want to do is to just help frustum culling run faster - and I was hoping I could achieve just that by setting the Occluder/Occludee Static flags on our rendered game objects.
    Frustum culling is currently eating like 6ms off of our testing devices CPUs. This varies based on the device type. But in general, for example on Galaxy S4 i9506 the game is running on 50-60 FPS. It is CPU bottlenecked on this device. And the CPU is getting hit a little too hard by the culling in my opinion. Our scenes have like... 150 - 250 rendered objects in them at any given time?