PDA

View Full Version : basic matrix question


hyperzoanoid
2003.09.27, 02:12 PM
in the opengl red book it says that

"you might want to keep the identity matrix at the bottom of the stack so you dont have to call glLoadIdentity() as often."

Since some hardware is optimized for matrix stacks, is it faster to pop the identity matrix or just call glLoadIdentity?

Josh
2003.09.27, 02:36 PM
I doubt the speed difference between the two is very much at all.

hyperzoanoid
2003.09.27, 06:25 PM
cool, thanks :)

DoG
2003.09.27, 07:06 PM
Assuming that you do your own matrix math, which is the fast path, except for drawing, where you would naturally push your objects' matrix to the opengl stack, you probably dont have to load the identity matrix onto the stack more than once or twice a frame anyhow (as the first thing before drawing).