Archived

This topic is now archived and is closed to further replies.

does gl automatically do frustum culling?

This topic is 5377 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I did a bit of research, and I'm pretty sure it doesn't. According to MSDN: "The glFrustum function multiplies the current matrix by a perspective matrix." If it did frustum cull for you, that would mean checking each and every polygon in the scene against the frustum to find out if they were visible and that would hinder performance more than it would increase it. I tried checking each poly against the frustum (just for the heck of it). I suffered a 200fps drop in framerate. I think I'm straying off topic here though...



-------------------
Realm Games Company


[edited by - greatone on March 23, 2003 6:59:50 PM]

Share this post


Link to post
Share on other sites
What cowsarenotevil meant is that it does clipping. So if your polygon lies outside the view frustum, it doesn''t get drawn, because it gets clipped to nothing.

Share this post


Link to post
Share on other sites
OGL does not draw things off screen. However, it still has to deal with all the data you sent it. It is best to do your own culling to stop OGL spending time on things it doesn''t need.

Share this post


Link to post
Share on other sites
OpenGL does indeed do frustum-clipping. If you modify the projection matrix in any way (glFrustum, glOrtho, manual glLoadMatrix, etc), the system will internally extract the clipping planes, and clip each and every triangle against each plane. Since dedicated hardware is available for that, it does not reduce performance.

On the other hand, OpenGL does no frustum culling. This is up to you, and should be done in more or less large clusterized chunks. You can use octrees, BSPs, ABTs, etc, for that job.

Share this post


Link to post
Share on other sites
Okay well just to straighten this all up, GL can clip objects that I send to it so that it doesn''t draw objects off of the screen, but I should perform some of my own calculations in software so that the actual amount I''m sending to GL is lessened. I understand that you should first determine where you are in the world (by traversing a binary tree or something else) until you get to a node with polygon data, then you do frustum culling (which is distinctly different than culling because culling implies it never gets sent to GL) and then you send the final visible list to OpenGL.

Share this post


Link to post
Share on other sites