In my current scenegraph I’m naievely binding my textures, shaders, vbos and whatnot for every object I draw. Frequently I am rebiniding the same information for subsequent objects. The way I understand it, binding takes up a good chunk of rendering time. Is OpenGL smart enough to catch this, or should I be tracking these repeated bindings and skipping them?
Also, does glEnable()/glDisable() have a lot of overhead?
Track state changes in your renderer and avoid redundent calls.
Sort objects to avoid redundent calls. Sorting can be complex since you might want to sort for multiple reasons (blending, texture, shader, texture 1, texture 2)