Hi, i’m having some problems regarding Occlusion Culling.
It wants to render far away meshes, that definitely could not be seen.
Also, when activating the Visualisation’s “Lines” option, i’m getting tons of “TODO IMPLEMENT” errors.
Here’s a picture of my problem (it’s a little big, that’s why i made it a link and no picture in this post): http://i.imgur.com/KQr6R.jpg
(also excuse my lame drawing skills in this picture ;))
The left half of this picture shows how meshes are rendered that are fare away, i edited into this picture the approximate far clip plane (it’s the same distance i use with fog, so i can tell that this is the distance).
The rooms and connecting tunnels have ceilings for calculating occlusion culling to block the view and yes, they’re marked as static, activated and their normals are correct if that matters.
Each big room and tunnel is one seperate mesh.
Two of those tunnels are culled correctly.
I might understand if the 2nd room sometimes gets rendered, but i cannot see why the 3rd and 4th rooms are rendered, they’re even far away from the set far clip plane.
The right half of the picture just shows my occlusion culling setup.
EDIT:
additional info:
There’s only one other active camera besides the main camera and it’s used for the UI, it’s orthographic, has a far clip plane of 25 and is placed out of sight.
Also if i turn away those room meshe get culled, but as i just slightly look into their direction they’re being drawn.
My question:
Is there anything wrong with my setup? Or how can i probably solve this problem?
Thanks for reading and even more thanks in advance, if you answer:smile:
This lines going some places the player cannot see and so, calculate meshes I don’t need. I’m also looking for a solution.
The ideal would be to be able to create some zones for each room and force the occlusion for all the meshes inside if the camera is in another predefined zone. (that’s what the occlusion culling is supposed to do but it clearly doesn’t work properly).
There’s lots of good hints and instructions about how to properly set up OC in Unity in their manual: http://unity3d.com/support/documentation/Manual/Occlusion%20Culling.html. If you set your near clip plane, cell size, memory limit, etc. following those suggestions and you still get undesired effects, I suggest submitting bug reports to Unity with your projects attached.
@Fuzzy: you should clearly submit a bug report, since getting TODO IMPLEMENT errors is clearly a sign of something being wrong.
Upfront: The Unity 3.5 OC works significantly better than the original one which was indeed broken to a degree where it was not production usable for anything but mobile gimmick games. (you will see corresponding comments from my end prior 3.5 towards that in masses)
Problem:
From the screenshot its hard to say where the camera is at start.
if it ever leaves the view area then OC is disabled completely, which could explain it, for example.
Also the UI camera you mention should potentially be limited on the layers it renders to ensure you get no overlap.
Orthographic cameras work quite a bit differently than normal ones and have a fair amount of limitations and exceptions in their rendering handling (shadows would be another case)
Generally I would put the UI camera somewhere below ground orienting it down. That way you can rest assured that it never sees anything even if you messup the layer setup