OpenGL's immediate mode

A place to discuss the science of computers and programs, from algorithms to computability.

Formal proofs preferred.

Moderators: phlip, Moderators General, Prelates

User avatar
Logan
Posts: 37
Joined: Sat Feb 21, 2009 1:45 am UTC

OpenGL's immediate mode

Postby Logan » Wed Mar 11, 2009 2:18 pm UTC

Does this really use up that much cpu time? I have been learning opengl this way. Only just heard about immediate mode

Logan

binomine
Posts: 5
Joined: Fri Jan 30, 2009 11:09 am UTC

Re: OpenGL's immediate mode

Postby binomine » Wed Mar 11, 2009 4:28 pm UTC

Yes.

If you don't include the start time to the first primitive, immediate mode and using vector arrays are about even, with an advantage to vector arrays. If you do include the first primitive, you'll find that immediate mode is much slower than vector arrays. When I tested my GeForce2, it was about 3 times slower. There's a huge hit from using immediate mode, from state changes of using immediate mode, the ease of bad design by not clumping all the same data together, and the fact that GPUs are designed around vector arrays, since that's the fastest way to begin with and the only way Direct3D does it.

Immediate mode is fairly easy, and can be used in non-realtime applications like CAD or simple games. It's easy to use and let's face it, easy is always good. If you plan on making anything complex, you should learn about vector arrays.

User avatar
Logan
Posts: 37
Joined: Sat Feb 21, 2009 1:45 am UTC

Re: OpenGL's immediate mode

Postby Logan » Wed Mar 11, 2009 6:14 pm UTC

I plan to develop a program in realtime. I guess i will have to take your advice Thanks for your quick reply

Logan

User avatar
taby
Posts: 154
Joined: Thu Nov 01, 2007 8:39 pm UTC
Location: Canada

Re: OpenGL's immediate mode

Postby taby » Fri Mar 13, 2009 9:47 pm UTC

Just to clarify:

Vertex Buffer Objects are sometimes better to use than vertex arrays, which are sometimes better to use than display lists, which are sometimes better than making the same immediate mode calls over and over again for each frame.

So, considering both speed and flexibility, there are actually four options for you to consider, with VBOs being the most modern one.

http://www.ozone3d.net/tutorials/opengl_vbo.php
http://www.sci.utah.edu/~bavoil/opengl/


Return to “Computer Science”

Who is online

Users browsing this forum: No registered users and 2 guests