Sign in to follow this  
Cornstalks

Ways To Improve Rendering Code? [solved]

Recommended Posts

Cornstalks    7030
I'm using OpenGL and C++. I've been making a game engine lately, and I've got it to the point where I can draw objects by drawing each polygon. Other engines seem to be able to ignore drawing objects once they are out of the screen. How would you do this? [Edited by - MikeTacular on March 12, 2006 5:45:46 PM]

Share this post


Link to post
Share on other sites
jyk    2094
Quote:
Original post by MikeTacular
I'm using OpenGL and C++. I've been making a game engine lately, and I've got it to the point where I can draw objects by drawing each polygon. Other engines seem to be able to ignore drawing objects once they are out of the screen. How would you do this?
'Frustum culling'.

OpenGL can cull individual triangles much faster than you can. Frustum culling becomes useful though when you have many, many triangles and can group them together in some meaningful way, such as by object, or in a hierarchical structure such as an octree. In these cases frustum culling can greatly accelerate rendering.

If you want to perform frustum culling yourself, the first step is to construct the frustum planes given the current camera and projection matrices. A good article on how to do this can be found here.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this