Sign in to follow this  

Circular buffer

Recommended Posts

montka    104

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?
Edited by montka

Share this post

Link to post
Share on other sites
cgrant    1825

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)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this