0

enter image description here

While I was writing some code for rendering a shape, idea of removing duplicate data by using two VBO came into my mind. I would create two VBOs and only add unique data into first VBO0 and store all common, shared, data at VBO1. Creating VBO, VAO had no issues. And even gl.glDrawArrays threw no error. The problem is that I'm not getting constant result. And by thinking of it, I understood that there is no way OpenGL would automatically interleave two VBOs for my convenience.
Still, I can assume there is a way to work this way as this seems to be a common design problem that a programmer would encounter. So how can I make it work? How can I command OpenGL to interleave two VBOs? ('common data' is a data per vertex, so uniform can't substitute, ...perhaps?)

김기영
  • 59
  • 5
  • oh shoot. You are right. Fixed the drawing. So what I wanted to describe is circular(?) interleaving. Of course, in this case, I could call two draw calls with index buffer while streaming fourth value as a uniform. But I want to know if there is a way to do it with single draw call. For example, if there is size 10 attributes that has to be repeated, calling 10 draw function with 10 index buffer feels inappropriate. – 김기영 Apr 28 '21 at 03:23

0 Answers0