- Home /
Problems With Occlusion Culling
I'm trying to implement Unity's standard occlusion culling but I'm having trouble getting good results. A lot of objects that seem like they should be occluded are still being drawn.
Some info about the project/scene:
I'm using URP.
I have one camera in the scene and it has Occlusion Culling enabled and set to Everything.
All of my objects are static occluders and occludees (and all the other static flags are also enabled on them).
The walls, floors and other structural geometry are mostly modular, so there are very few large meshes that would be occluded poorly in that regard. Most of the geometry that's not occluding is opaque (and has an opaque material)
What I've tried:
I turned off static batching, SRP batcher and GPU instancing in case that was causing problems but there was no change.
I've tried various occlusion baking settings which did change the output but no combination gave good results.
I turned off dynamic occlusion on objects, that had no effect.
Occlusion culling is definitely working in some capacity but it's not working properly, or at least not well enough. The visibility lines pass through a bunch of geometry and end up drawing objects that are on the other side of the level with many objects in between.
Here are some screenshots of the scene:
Top Left is what the scene looks like without occlusion:
Bottom right is the scene with occlusion on, with the camera to the left. You can see on the top right there's a section of the level that's behind multiple layers of walls and yet is still drawing:
Bottom left is the previous image with visibility lines enabled. Honestly I'm not entirely sure how these work but it seems strange to me that they're going as far as they are:
Bottom Right is the camera view
Here's an example of a visibility line just straight up going through solid geometry:
Any insight on why the results aren't great would be appreciated. Am I doing something wrong? Or am I just hitting engine limitations?
Thanks
Your answer
Follow this Question
Related Questions
Trouble with Occlusion Culling 0 Answers
Render Gameobjects in one specific Layer as transparent, 1 Answer
Occlusion Culling - unloads or just doesnt render? 1 Answer
Unity Procedural Game Optimization 3 Answers
Can I not occlussion cull stuff that has been copied in my level, like the walls? 0 Answers