Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Circular buffer

4: Adsense
  • You cannot reply to this topic
1 reply to this topic

#1 montka   Members   

104
Like
0Likes
Like

Posted 20 March 2017 - 11:34 AM

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, 20 March 2017 - 11:34 AM.


#2 cgrant   Members   

1787
Like
0Likes
Like

Posted 20 March 2017 - 12:05 PM

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)