Subscribe RSS

Tag-Archive for "3d"

Frustum Culling in OpenGL Nov 16

[I originally published this article in December of 2000]

Imagine you are writing a program that lets the user wander around in a virtual world that’s chock full of trees, buildings, cars, people, and all sorts of other objects. What would your main rendering loop look like?

The simplest and most obvious thing to do would be to loop through all of the objects in your world and tell OpenGL to draw each one. After all, OpenGL clips everything for you so you don’t have to worry about objects that are off-screen. Everything will look correct when it’s done.

If you only had a few objects, that method would probably suffice. But as you add more and more objects to your world you’ll find that things bog down pretty quickly. It won’t be long before your frame rate plummets.

Now, it’s likely that only a small fraction of the objects in your world are actually visible at any given moment. If you could somehow determine that an object will not be visible before you draw it, you could just skip it and avoid sending all that extra data down the OpenGL pipeline in the first place.

One way to do this is known as Frustum Culling.
more…

Category: C, Programming  | Tags: , ,  | Leave a Comment