Hey everyone, today I’ve run into a weird issue and I hope someone can help me to solve this mystery.
I’m working on a huge dungeon level, and so far occlusion culling worked fine for me here. Today, I’ve just added another room, pretty basic, without too much stuff and details yet. Then, to my surprise, I noticed that the triangle count is above 700k when standing in that room, even with active occlusion culling. Obviously, this number is way too high for the given scene; I would have expected something below 10k.
As a usual step to research the origin of the problem, I turned on occlusion culling visualization. Surprisingly, it seemed as occlusion culling worked fine as the visualization only shows a small part of the level geometry (see overdraw picture).
The above picture shows that occlusion culling seems to be working fine, because only a small scene is visible here. However, what is visible here cannot create a triangle count of 700k+ on its own. Thus, it seems that the rendered triangle count in game does not match with the occlusion culling visualization.
These findings made me presume that other parts of the dungeon were still being calculated, despite the fact that they actually should be occluded.
Behind the walls of the room I was standing in and that is seen on the pictures, there is another much bigger room, as shown on the following picture. For debugging, I completely disabled this room to see if it has an effect on the triangles count, and voila: after deactivating the big room, the triangles go to 7.8k which is more reasonable for the current scene. Thus, it seems to me that most of the triangles of this big room (if not all) are completely calculated, ignoring the occlusion culling.
While I have some hints now, I do not know how to solve the problem.
The occlusion culling visualization does not match with the triagnles being rendered/calculated. It just seems that some parts of the dungeon are still being calculated, even if they are occluded. Maybe I did something wrong at another point? I don’t know.
Any help is much appreciated!
Thanks and all the best,
Moritz