Ways To Improve Rendering Code? [solved]

Started by
2 comments, last by soconne 18 years, 1 month ago
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]
[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]
Advertisement
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.
Thank you very much. That was exactly what I was looking for.
[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]
Author Freeworld3Dhttp://www.freeworld3d.org

This topic is closed to new replies.

Advertisement