   glPopMatrix vs Matrix-storage
  I''ve just read atutorial where the programmer stored the matrix instead of using glPopMatrix (granted, it was a DirectX tutorial, but still) for passing the world-space changes to it''s children. and I remember reading somewhere that glPopMatrix is limited to a certain number of stacks.So, is it better to store the node''s matrix and then sending it to OpenGl, or is it still better to use glPopMatrix? 
  I doubt this will be usefull. Any kind of readbacks from GPU are slow. You''re much better of by using glPushMatrix/gl*Matrix/glPopMatrix combination. The only place you might want to do readback is in places where you would need very big stack. And even there some implementations switch to SW mode automaticly.   You should never let your fears become the boundaries of your dreams. ;  True. Extracting the matrix is slow. That's what went to my mind when I read the article. But then, he didn't extracted the matrix from the gpu. He started from an identity matrix. When the object is translated, he would manually do the matrix math and store the result on a variable in the object.So if he was to draw the object, he would simply send the matrix to the GPU.Sorry if I'm a little confusing.  [edited by - s_cloudx on February 4, 2004 3:21:54 AM];  Ah. . . I see what he was doing.  He wasn''t using D3D''s equivalents to glRotate, glTranslate, and such.  Instead he was creating the matrices manually and tossing them into OpenGL via glLoadMatrix.  Alot of people actually recommend doing this.Still, using the matrix stack still remains a good idea -- especially when you''re dealing with scene graphs.  In that case, the position of a given object may be relative to the position of its parent.  In that case, one might render the parent, then render a child-object, then render something with the parent''s matrix again.  In such a situation one could load the parent matrix, then multiply that by the child matrix, then in the end load the parent matrix again.  However, it would probably ultimately cheaper to push the parent matrix before rendering the child, then popping it back again afterwards.  This way, you avoid sending the same matrix across the AGP bus more than once per frame, saving a little bit of bandwidth. ;quote:Original post by Ostsol  This way, you avoid sending the same matrix across the AGP bus more than once per frame, saving a little bit of bandwidth.   Hmmm. You''re right. But then, a matrix array consists of 16 floats (Correct if I''m wrong). That is like sending 16 vertices to the GPU. Using the matrix method, we could have almost unlimited stack/children. With glPopMatrix and glPushMatrix, the stack would be limited. Of course, the limitation to the matrix method, is that not all of graphic cards has an optimized matrix pipeline (I''m just speculating. I didn''t profile my card. Please correct me if I''m wrong here). I''m guessing that the matrix is slower.Any thoughts? ;  The problem with constantly loading the matrix is purely an AGP bandwidth problem.  Pushing and popping matrices only concerns the video card''s internal bandwidth.  The stack is limited, but it''s still large enough for the -vast- majority of scenes one might want to render.  Some matrix stack depths:Radeon 8500:  Modelview Matrix: 32Projection Matrix: 10Texture Matrix: 10Program Matrix: 16Geforce 4 ti4200:  Modelview Matrix: 32Projection Matrix: 4Texture Matrix: 10Program Matrix: 1 