What's the purpose of marking something as 'occludee static'? How to ignore occlusion?
Hi,
Browsing through the documentation on occlusion culling, this is all that's said on occludee static :
When should you use Occludee Static? Transparent objects that do not occlude, as well as small objects that are unlikely to occlude other things, should be marked as Occludees, but not Occluders. This means they will be considered in occlusion by other objects, but will not be considered as occluders themselves, which will help reduce computation.
So, my understanding of it was bascially "occludee static = things that will not be computed when hidden by an occluder static".
But truth is that even items that are not marked as occludee or even as static are not computed either !
The problem being that if ticking "occludee static" is not the way to say "hey, Unity, I want you to optimize rendering time by not rendering this item", then how can we say "hey, Unity, I want you to keep rendering this item, even if you believe it's not visible".
You'll ask me how is that a problem since the object is hidden behind another?
What if I want my camera to see something through a wall? I can use a shader that ignores Z buffer (ZWrite Off).
How does occlusion reacts to that? It doesn't, so, although I should be able to see my item through a wall, it is occluded.
Please, do not let this question be unanswered, I've come accross several similar questions, always unanswered, as if occlusion was some feature no one ever used !
- http://answers.unity3d.com/questions/642127/occlusion-culling-issue-wallsobjects-disappear.html
- http://answers.unity3d.com/questions/1244489/how-to-ignore-some-objects-in-occlusion-culling.html
- http://answers.unity3d.com/questions/571583/how-to-ignore-occlusion-culling-on-specific-render.html
- http://answers.unity3d.com/questions/1268275/non-static-occludee-hidden-by-occluder.html
Thank you.
So ZWrite Off is set in the shader of the wall, the object behind is either occludee static or not and still never seen?
Not exactly, I didn't want to give more details on my exact use case so I wouldn't confuse everyone but here is the exact problem : I'm working on a VR project.
In VR project, we can't use screen canvas, we have to use world canvas. So, when my user opens the menu, a world space canvas appear 2-3 meters in front of him. The problem is that depending on where he is / where he is looking at, 2-3 meters away from him might be behind a wall. So I added a material to my GUI using a shader to set ZWrite Off. It works very well, except that, with occlusion baked : as the wall is an occluder, my GUI isn't expected to be visible by the occlusion system and is disappearing... Although it's not static (so neither occludee nor occluder)
But I need the occlusion to optimize the app ! Laggy VR apps are a no go...
@ DorianF
I'd like to know too.. The static settings on game objects \ lights seem really useful. But how the heck do we take advantage of them?
Your answer
![](https://koobas.hobune.stream/wayback/20220612105727im_/https://answers.unity.com/themes/thub/images/avi.jpg)