What kinds of culling does OpenGL handle?

Started by
2 comments, last by Yann L 13 years, 7 months ago
I know that there is back-face culling. Does OpenGL also do view frustum culling? I'm trying to determine what kind of culling I need to handle in my code.

Would it be more efficient if I programmed all culling myself?

Aside from back face and frustum culling, is the main thing to worry about then occlusion culling?

Thanks.
Advertisement
Quote:Original post by PrestoChung
Does OpenGL also do view frustum culling?

Well, obviously it does, since 3D rendering doesn't work without frustum culling...

Quote:Original post by PrestoChung
Would it be more efficient if I programmed all culling myself?

No. It would probably slow you down by a factor of 100 or more.

Quote:
Aside from back face and frustum culling, is the main thing to worry about then occlusion culling?

High level culling is much more important. Create a spatial tree containing your geometry, cull the tree on the CPU, and send the remaining batches to the GPU. The latter will then handle all the fine level per-face culling.

Once you got all that working, then you can start worrying about occlusion culling.
Quote:Original post by Yann L
Create a spatial tree containing your geometry, cull the tree on the CPU, and send the remaining batches to the GPU. The latter will then handle all the fine level per-face culling.

Once you got all that working, then you can start worrying about occlusion culling.


When you say do culling on the tree, what kind of culling do you mean, if not backface, frustum or occlusion?

And for spatial trees do you mean something like an octree? And could that stand in for a scene-graph?

Thanks again.
You cannot strictly categorize culling methods into distinct subgroups. Many culling algorithms overlap, and there are many more than the three basic types you mentioned.

The GPU handles:

1) per-face winding order culling. This is commonly called backface culling, but that is a misnomer.

2) Geometric clipping against a set of plane equations. This is typically used to cull against a frustum, and optional additional planes (clip planes), but other uses are possible. See oblique frustum clipping, for example.

3) Per-batch boolean culling. Named 'conditional rendering', it must be used with a separate detector algorithm, which is usually an occlusion query. Do to internal scheduling reasons, this system is typically not too effective.

On top of that, other custom culling systems are doable by using shaders.

On the CPU, you should never ever do per-face culling. You will send geometry in batches to the GPU. You can use the CPU to cull these batches against whatever you want. Usually that would be the frustum and possible an occlusion query (HOM, portal, etc), but many more variants such as importance culling, motion culling, LOD systems, etc, are doable.

In order to speed up rendering of large scenes, you need a hierarchical culling structure. You slice up your geometry into spatial zones that are connected by a hierarchy or another logical or spatial relationship. You traverse this hierarchy or resolve the relationship on the CPU, culling each nodes extents against whatever metric you choose. You only send the final leaf nodes that passed all tests to the GPU.

Countless different algorithms exist to partition geometry spatially, octtrees being only one of them (not a particularly good one though).

This topic is closed to new replies.

Advertisement