I’m currently implementing VBOs into my engine and some things are still unclear to me even after reading a lot of material on the net.
-
Allmost all whitepapers I read said that you should reduce number of batchs/frame as mutch as possible becouse it overloads CPU, its also said that a batch is a call like glDrawArrays, glDrawElements, etc… but when I use VBO with a static data ( GL_STATIC_DRAW ) and draw a geometry with glDrawElements is it still a batch or not? Usualy no data are transfered from comuputer to g. card so CPU shouldnt perform any activity…
-
In all demos about VBOs I saw construction like this : bindBuffer, setXXPointer… draw, unbindBuffer. I have also read that glVertexPointer() is an expensive call when using VBOs. However do I really need to set glVertexPointer ( and other xxPointers too ) before each draw call? I can imagine a situation when I have many VBOs but offsets of vertex data,normal data, etc are same for all of them so my idea is just to implement some simple cache where I will remember last offsets and change the glXXPointer only if its necessary. I have tested it and it worked but im not sure if its a correct approach and if it really provides any performance benefit.
thanks for answers