0

I want to store my indexed geometry in a shared vao.

If the current vao is full, I create another vao together with the buffers for the layouts (Pos, Normals, Uvs, etc..). I create them with a capacity for say, N vertices. (Could be thousands, I want to share the max amount of similar geometry I can)

The problem is that I don't know how much size to allocate for the Element Buffer Object that should back the indexed vao.

Is there a common practice for this?

I need a single EBO for each VAO because I want to draw the whole batch with a glMultiDrawElements call, so the batch must have the indices in the same EBO.

BDL
  • 21,052
  • 22
  • 49
  • 55
Fruff
  • 47
  • 6
  • 2
    "*I want to draw the whole batch with a glMultiDrawElements call*" So, wouldn't that mean that you're using the *same* VAO for all of the objects? Also, VAO's don't get "full", so it's not clear what you're asking. – Nicol Bolas May 05 '18 at 13:15
  • VAO's don't get full but the array buffers bounded to it surely can become full. So, whenever I create a VAO, I create also the buffers for the layouts and then i start to load geometry inside them. At a certain point in the program, i can load more geometry and those buffers become full. Therefore i create a new VAO with it's owns buffers bounded to it. – Fruff May 05 '18 at 14:29
  • The size of indices buffer depends on rendering with triangle-strip, fan, independat, etc. – Ripi2 May 05 '18 at 15:09

0 Answers0