<p>I have 3 objects in my scene, each one is being passed to the buffer and drawn as part of a different Vertex Array Object, so for the 3 objects i have:
<code>vao1</code>, <code>vao2</code>, <code>vao3</code>.</p>

<p><code>Object1</code> is drawn using <code>glDrawElementsInstanced</code>.</p>

<p><code>Object2</code> is drawn using <code>glDrawElementsInstanced</code>.</p>

<p><code>Object3</code> is drawn using <code>glDrawArraysInstanced</code>.</p>

<p>All of those instances of all of those objects create one big object. So how can i take that big object (meaning - treat all 3 object as one) and draw it 5 times using instancing?</p>

<p>Thanks!</p>

CC BY-SA 3.0
2017-03-01T15:07:14.863Z
at some point you have no choice but to call glDraw* multiple times with different uniforms.
ratchet freak
CC BY-SA 3.0
2017-03-01T16:29:05.997Z
I don't think that you can treat these 3 objects as one because they belong to different `vaos`. You can't bind more than one `vao` at the time.
mdkdy
<opengl>
OpenGL - how to draw instances of several objects?
gambit20088
# OpenGL - how to draw instances of several objects?

(Asked by: username_0 on 2017-03-01)

I have 3 objects in my scene, each one is being passed to the buffer and drawn as part of a different Vertex Array Object, so for the 3 objects i have:
`vao1`, `vao2`, `vao3`.

`Object1` is drawn using `glDrawElementsInstanced`.

`Object2` is drawn using `glDrawElementsInstanced`.

`Object3` is drawn using `glDrawArraysInstanced`.

All of those instances of all of those objects create one big object. So how can i take that big object (meaning - treat all 3 object as one) and draw it 5 times using instancing?

Thanks!

**Tags:** opengl

> **Comments:**
> **username_1**: at some point you have no choice but to call glDraw* multiple times with different uniforms.  
> **username_2**: I don't think that you can treat these 3 objects as one because they belong to different `vaos`. You can't bind more than one `vao` at the time.  

---

## 0 answers

