Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Confused about Frustum Culling

I'm new to OpenGL. I'm using it with JOGL.

I'm reading about frustum culling:

http://www.lighthouse3d.com/opengl/viewfrustum/

http://www.crownandcutlass.com/features/technicaldetails/frustum.html

I'm not sure exactly what it's supposed to do. Doesn't OpenGL cull off-screen objects automatically? (Is this culling significantly slower than just not sending the objects in the first place?)

From what I'm reading, it doesn't look like this will handle avoiding drawing objects that are obscured behind another but are within the viewing frustum. Does that mean that the only benefit is avoid sending off-screen objects to OpenGL?

like image 884
Nick Heiner Avatar asked Sep 27 '10 20:09

Nick Heiner


People also ask

How is frustum culling implemented?

The simplest implementation is to wrap both nearest objects in a sphere. Wrap this sphere with another group or objetc etc... In this example, only 2 checks allow us to know that 3 objects are in frustum instead of 6 because if the bounding sphere is totally inside the frustum all its content is also inside.

What are the types of culling?

Three types of visibility culling techniques: 1) View-Frustum Culling, 2) back-face culling, and 3) occlusion culling. The last few years have witnessed tremendous growth in the complexity of computer graphics models as well as network-based computing.

Does OpenGL automatically cull?

By default, OpenGL expects counter-clockwise winding order for triangles that are facing forwards. With backface culling enabled, triangles facing the other direction will be automatically culled. This occurs before rasterization.


1 Answers

Yes, you are basically right. Frustum culling cuts off objects that are outside the camera pyramid. OpenGL, when rendering a scene, of course does this as well but on a per vertex basis. Frustum culling works per object and its performance boost potential is therefore much higher.
One of the bottlenecks is transferring the data between CPU and GPU. If you need to transfer for example only 1/4 of all the objects/vertices in an outdoor scene, frustum culling can yield a nice performance boost.

like image 93
Karel Petranek Avatar answered Sep 17 '22 01:09

Karel Petranek