- Home /
Does an occluded object/mesh still cost anything?
Does it cost a draw call or material cost or anything still? If it doesnt, I don't really see there being much of a point in using batching if your using occlusion and LOD already. Because draw calls from massive amounts of gameobjects would be cut way down by LOD, so then the pieces you were going to batch, are usually not even being rendered... So idk, maybe there is a slight advantage to sit, but it would only really make a difference with immediate surroundings I think, in lets say a first person game.
So, thats why im wondering, if there is a cost still for things that are occluded, because then maybe batching would still be worthwile.
Answer by Benproductions1 · Sep 17, 2013 at 04:23 AM
Hello,
The whole point of Occlusion Colling or View Frustrum Culling is to reduce the draw call count therefore reducing performance cost. If this didn't happen there would be no point of Occlusion. However, the object itself still contains the standard overhead that comes with every object and that cannot be "occluded".
Batching will further reduce the draw calls, by (quite literally) compressing the data sending to the GPU. It does this by combining duplicate "updates" into a single one.
Given this information, lets look at an example: Imagine a gigantic house full of many many objects. All objects share the same material and nothering else special is going on. If you turned off all culling and all batching you would most likely get a very bad framerate. Lets look at how they individually impact in certain situations:
1. View Frustrum Culling: Very easy to understand. If you're not looking in the direction of something, it will not render. If you looked out the window of the house you would get a very large increase in framerate, however if you looked into the building it would do absolutely nothing to help.
2. Occlusion Culling: Again, easy to understand, if you're not looking at something (ie it's hidden from view), it will not render. This means that if you are in a room with a small amount of objects you will get high framerate, but if you go into larger rooms your framerate will drop. Note that the way you are facing has no impact on Occlusion Culling.
3. Batching: Because of the fact that your building is made up entirely of one material, batching will reduce the draw calls all the way down to 1 (from a couple thousand). No matter where you go or where you look (unless you can't see the building) you will get 1 draw call. Obviously this significantly reduces performance impact, even though it has no impact on what is acctually rendered
Culling impacts the amount of time the GPU takes to render, while Batching reduces the overhead on the CPU of rendering (sending the data to the GPU)
It depends on your game wether you should use Occlusion Culling (it might even decrease performance in some cases), but if you have any sane design for your scenes, batching will always increase performance.
Hope this helps,
Benproductions1
Ah yes, you are right for my immediate question. I realized I veered off into what I really wanted to know about, below that, with LOD in the mix. I meant occluded by LOD. Sorry I was unclear. But I think maybe that is something to post in the forums. Thanks for the help none the less!
I realize this is a really old thread, but it was the first result when I was searching for occlusion culling and draw calls.
I believe #2 in this answer is untrue.
Occlusion Culling is going to take samples throughout your scene and deter$$anonymous$$e what objects are blocked from view at those positions by other objects and which are not. For example, if you're in the house looking at a wall which has a room on the other side of the wall, we do not see the objects in the other room - because of the wall. If occlusion culling is in use (and baked), objects behind the wall will not be sent to the GPU as they aren't visible anyways. Without the occlusion culling being baked, it's going to send them to the GPU even though you won't be able to see them.
I use this technique heavily in my game.
I'm happy to be corrected though.