- Home /
Occlusion Culling rendering everything OUT (not wanted)
hey there i just found the option for occlusion culling and its working very good. but i realized it renders everything out but i want some stuff to be in the scene. is there an option where i can say that this objects should not be rendered out? and its not static... i did already use it, but occlusion culling ignores it and is rendering everything out.
any ideas what i could forgot?
Answer by Zarenityx · Aug 02, 2018 at 09:25 PM
I'm assuming by 'rendered out' you mean culled? Both Occlusion Culling (culls objects that are behind others) and Frustum Culling (culls objects that are outside your camera's field of view, always on) will cull objects that you wouldn't be able to see when actually rendering them to the screen (or RT), but have no effect on the objects themselves or their scripts. Even if an object is culled, it still exists and will still execute scripts as usual.
The only reason really to exclude something from occlusion culling is if it's visible under abnormal conditions. Something like player outlines through walls or the like would need to be excluded from occlusion culling.
Unfortunately, there's not real good builtin way to do this. It is possible, however. You would need to give those special 'see-through-walls' objects their own layer, then render them with a second camera set to only render that layer, with occlusion culling off on that camera. If you're already using a separate camera for held items or something, you can just use that.
On an unrelated note, that's a LOT of AudioSources. You might want to remove some. Rule of 2.5 and all.
ok thanks. yeah we have in the game a cone around our building and a sky texture inside it. so we can see the sky when watching outside the windows.. i know.. why dont just go for a skybox^^ its comlicated with my $$anonymous$$m.. so the problem is just, this cone is culling too, but i dont want to cull it. and i know we got a lot of audiosources, its for our drewers, they are making a sound when opening. i dont know any other way to do it better at the moment
Ah, ok...
Are your windows Occluder Static? If you hit the dropdown menu next to the Static checkbox, one of those is Occluder Static. Disabling it and rebaking occlusion culling should prevent them from occluding the sky. It's also a good idea to disable Occludee Static on the sky.
Also, check the voxel size on your occlusion culling. Bigger is faster, but too big will just skip over holes like this.
If all else fails, there's also https://docs.unity3d.com/$$anonymous$$anual/class-OcclusionPortal.html.
Your answer
Follow this Question
Related Questions
Occlusion Culling in a Web Player 2 Answers
Custom terrain mesh - loss of LOD worth it if trees are occluded with occlusion culling? 0 Answers
What happens to covered up vertices on geometry? 0 Answers
How to change Occlusion Portal size via script? 0 Answers
Can you disable shadows that are not seen by the camera ? 1 Answer