Original Post
I tried to implement a scene graph in my engine, but perhaps I was going about it the wrong way because it's pretty inefficient and seems to hurt performance. For each frame, I go through my scene's quadtree and add each visible object to the graph. The graph then uses a breadth-first search to find a "texture" node that matches the texture on the object, and then adds the object under that node. Traversing the scene graph goes: 1) draw the top node (the player perspective, so the camera is positioned) 2) draw each node of the next level and its children (so bind texture, draw all objects with the same texture, move on to next texture...) Then the graph is deleted at the end of the frame drawing code. Am I missing something crucial? Is there a way to keep the graph stable? I had z-sorting, but that made things even slower than they are now, which is still slower than immediate mode even with ~250 drawn objects of the same texture. What am I doing wrong?