basic matrix question

Nibbie
Posts: 1
Joined: 2008.09
Post: #1
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?
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #2
I doubt the speed difference between the two is very much at all.
Quote this message in a reply
Nibbie
Posts: 1
Joined: 2008.09
Post: #3
cool, thanks Smile
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #4
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).
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Basic OpenGL reshape function question... WhatMeWorry 2 6,480 Mar 30, 2011 07:05 AM
Last Post: Ingemar
  Texture Basic Question(s)... WhatMeWorry 2 3,226 Feb 27, 2007 10:06 AM
Last Post: arekkusu
  Depth Buffer / Testing basic question... WhatMeWorry 5 6,321 Nov 18, 2005 12:50 AM
Last Post: arekkusu
  Perspective View Question, (GL_PROJECTION Matrix), and GUI hangt5 3 5,080 Sep 11, 2005 11:17 PM
Last Post: hangt5