In my quest to optimize I read NVIDIA’s paper regarding VBOs.
There, one can read: “The “glVertexArray” function does a lot of setup in VBO, so to avoid redundancy, avoid calling it.”
so, if I were to do:
//first pass
glBindBufferARB(GL_ARRAY_BUFFER_ARB,1);
GlVertexPointer(3,GL_FLOAT,stride,(void*)0);
GlNormalPointer(GL_FLOAT,stride,(void*)12);glBindBufferARB(GL_ARRAY_BUFFER_ARB,2);
GlVertexPointer(3,GL_FLOAT,stride,(void*)12);
GlNormalPointer(GL_FLOAT,stride,(void*)24);//other passes
glBindBufferARB(GL_ARRAY_BUFFER_ARB,1);
//draw
glBindBufferARB(GL_ARRAY_BUFFER_ARB,2);
//draw
In the last case, where the drawing occurs, the binding explicit changes the pointers offsets?
If not, does binding make previous offset undefined?
In my actuall code I have two passes, where the offsets remain the samed from one pass to another and even for diferent VBOs during thoose passes. Then I figured that maybe the offsets in the second pass where doing nothing. I commented them and everything got screwed… Why? I can’t see any reason to, unless glBindBufferARB makes any previous indicated offsets invalid witch, after reading the ARB_vertex_buffer_object spec, seems wrong to me…
I would like very much for things to work like I wrote above… But it doesn’t seem that way.
[This message has been edited by KRONOS (edited 12-11-2003).]