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

Way to turn off Occlusion Culling for certain objects?

Discussion in 'Editor & General Support' started by rstorm000, Jan 18, 2014.

  1. rstorm000

    rstorm000

    Joined:
    Aug 19, 2010
    Posts:
    228
    I've noticed that the new culling system will also block dynamic objects automatically. This is good except for sometimes it culls certain important objects that shouldn't be culled (like players). Is there any way now to specify for a dynamic object to be rendered no matter what?
     
  2. rstorm000

    rstorm000

    Joined:
    Aug 19, 2010
    Posts:
    228
    bump
     
    JaysonMaatoke likes this.
  3. Deleted User

    Deleted User

    Guest

    Are you not supposed to layer your objects to be culled, so you would leave your players out of it before culling? I could be missing a trick here, has something changed?
     
  4. rstorm000

    rstorm000

    Joined:
    Aug 19, 2010
    Posts:
    228
    I think you are thinking of just normal camera culling layers, not occlusion culling
     
  5. Deleted User

    Deleted User

    Guest

    "You need to tag all scene objects that you want to be part of the occlusion to Occluder Static in the Inspector. The fastest way to do this is to multi-select the objects you want to be included in occlusion calculations, and mark them as Occluder Static and Occludee Static."

    You'd be wrong in guessing what I'm thinking:

    http://docs.unity3d.com/Documentation/Manual/OcclusionCulling.html

    Or you could do what I did and build your own Occlusion culling and LOD system. It can save a lot of headaches :)..
     
    Last edited by a moderator: Jan 28, 2014
  6. rstorm000

    rstorm000

    Joined:
    Aug 19, 2010
    Posts:
    228
    the docs you linked are about the old occlusion system which doesn't really exist anymore. What's strange with this new system is that it is culling DYNAMIC objects which are not checked as static in anyway whatsoever. This can be useful sometimes, but not for all dynamic objects.
     
  7. Deleted User

    Deleted User

    Guest

    As I say, I built my own.. Let me check it out and get back to you, but it sounds familiar as the "old" one used to remove object's by itself anyway.
     
  8. littledove

    littledove

    Joined:
    Aug 31, 2016
    Posts:
    1
    hi rstorm000,have you resolve this problem?
     
  9. mynameisjohnj

    mynameisjohnj

    Joined:
    Mar 18, 2017
    Posts:
    11
    Hey, I know this is pretty late. I was running into this with the LowPolyWaterGPU asset
    https://assetstore.unity.com/packages/vfx/shaders/substances/low-poly-water-gpu-79255
    For some reason when I ran in the oculus rift it would get culled incorrectly.

    At first I tried to change the mesh generation script to give the mesh bounds some height, but that didn't help. What did help was disabling "Dynamic Occluded" in the Renderer settings.
     
  10. SBliznitsov

    SBliznitsov

    Joined:
    Mar 13, 2019
    Posts:
    17
    Hello.
    Thanks for the tip, it actually works. It is also relevant for Unity 2020.
     
  11. unity_3driyr

    unity_3driyr

    Joined:
    Jan 24, 2019
    Posts:
    1
    Thank you, mynameisjohnj! It helps me a lot!
     
  12. ClearRoseOfWar

    ClearRoseOfWar

    Joined:
    Sep 6, 2015
    Posts:
    87
    The mesh appeared after turning on Dynamic Occluded in the renderer settings, however the shadow is still not visible; Any suggestions?

    EDIT: I ended up recalculating the occlusion culling and that fixed things for me (within reason [I have an overhead camera and the players shadow disappears in 1 corner of thousands so not a a big deal..])
     
    Last edited: Jun 2, 2021
  13. dingaloo12

    dingaloo12

    Joined:
    Jun 30, 2020
    Posts:
    10
    Such an ancient post, but as a quick cheat to the ORIGINAL question:

    If you want to have certain items ignore the occlusion culling system, simply disable them, bake your occlusion, and then re-enable them AFTER. It's definitely a bit of a cheat, and these objects will always be rendered and therefore will take a bit from your performance, but it works.

    If anyone has an alternative, such as getting the occlusion to be based both on sight and distance (for example, don't despawn things I'm not looking at if they're within 5 meters) I'd be happy to hear them. My issue was doors that I would rotate would still have their original positions recognized and not their new, open positions recognized in occlusion culling, and therefore they would dissapear when I opened them and moved passed their original position
     
  14. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    225
    but it's a really good idea. I did not think about it. Thank you very much for the tip!
     
    dingaloo12 likes this.