Circular buffer

Started by
0 comments, last by cgrant 7 years, 1 month ago

Good Morning!

I have been trying to implement circular buffer - main VBO contains N values, so I use:

glDrawArrays(GL_PATCHES, 0, N);

but the same VAO contains also different VBO with 6 elements. Data from this VBO should be wrapped- it means that the same value from second VBO should be used multiple times.

Is it possible? How can I do it?
Advertisement

The question is a little confusing as I can't establish if you are treating VAO and VBO interchangeably. A circular or ring buffer, just means that you have a buffer contain M x N instances where, N is the size of a block and M is the number of blocks ex. M = 3, N = 200 verts ( size irrelevant for now, but each vertex will be of the same size). If you are drawing everything at once, then that defeats the purpose of having the ring buffer to begin with. The idea is that you can for ex. draw from a block not currently in use by the GPU while updating to another block in the buffer. It stand to reason that if you are using VAO ( assuming that you are referring to the actual VAO and NOT a VBO ), then you will need M different VAO one for each block since you will need to store a different offset into the VBO(s)

This topic is closed to new replies.

Advertisement