Sign in to follow this  
David Clark

glLists - why the hell is it faster to have multiple glBegin(GL_TRIANGLE) than one?!

Recommended Posts

Redundant calls to glBegin(GL_TRIANGLE) seem to be making my code faster by 3 times :O! Heres a pastie: http://www.pastie.org/612337 Basically List 5 is:
begin triangle list
vertex
vertex
vertex 
......
vertex
vertex
vertex
end triangle list
and List 6 is:
begin triangles
vertex
vertex
vertex
end triangles
begin triangles
vertex
vertex
vertex
end triangles
...
begin triangle list
vertex
vertex
vertex
end triangle list Both lists have the exact same number of triangles in them. When I run my code, list 5 takes 0.09 seconds to draw, and list 6 takes me only 0.03! Can anyone see if i'm doing something stupid in my code? Is this normal? Its convenient the later is faster, but I have no idea why and its driving me mad! :( Thanks in advance :D

Share this post


Link to post
Share on other sites
When you compile a display list, the OpenGL calls you make are optimised by your graphics hardware, so when calling glCallList() the GPU is not necessarily executing the exact same instructions you called when the list was compiled.

During the compile lists process having losts of begins and ends must enable your GPU to optimise the rendering operations better. kind of wierd I know, but display lists are quiet old and the speed you get out of using them will vary depending on the GPU because of how the lists are compiled.

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