[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Issue with enable vertex attributes and re-binding VBOs


If I'm understanding you correctly this is the intended behavior; and OpenGL 3 works the same way.  BindBuffer(ARRAY_BUFFER, ) only sets the ARRAY_BUFFER state, it does not change where data is going to be fetched from.  When you call VertexAttribPointer it binds the current ARRAY_BUFFER to that attribute.  This allows you to take attributes from multiple different VBOs in one draw call.

If you only call BindBuffer and not VertexAttribPointer you will continue to fetch from the buffer that was bound when you called VertexAttribPointer.

-- Kenneth Waters