<p>If you need to update data, then you need to update data <em>regardless</em> of the mechanism you use to render the object. If you have 3000 objects to be rendered, and each frame they will be rendered with a different matrix transform, then you will have to send 192,000 bytes of memory (64-bytes-per-matrix) every frame. Whether explicitly through a write to buffer object storage or implicitly through setting uniform values, 192,000 bytes of data are going to have to find their way from CPU-space to GPU-space.</p>
<p>So long as you use reasonable <a href="https://www.khronos.org/opengl/wiki/Buffer_Object_Streaming" rel="nofollow noreferrer">buffer object streaming techniques</a>, performance due to sending data shouldn't be a problem relative to other ways to send the data. Especially for fairly small data like per-model transforms. Of course, good buffer streaming does require having two buffers, but that's a memory storage tradeoff, not a runtime performance cost.</p>

CC BY-SA 4.0
2020-11-01T06:49:49.993Z
2020-11-01T06:49:49.993Z
Nicol Bolas
<p>With the help of instanced arrays we can specify an array of transforms and render a number of objects with a single render call. I'm wondering if using instanced arrays make sense in situations where the transforms of the objects need to be updated on each frame? In that case we would need to reupload the buffer with transforms on every frame. Is this practical or should we use individual rendering or <code>gl_Instance_ID</code> (if the number of instances is not too high) instead?</p>

<opengl>
Using instanced arrays for dynamic objects
Lenny White
# Using instanced arrays for dynamic objects

(Asked by: username_0 on 2020-10-31)

With the help of instanced arrays we can specify an array of transforms and render a number of objects with a single render call. I'm wondering if using instanced arrays make sense in situations where the transforms of the objects need to be updated on each frame? In that case we would need to reupload the buffer with transforms on every frame. Is this practical or should we use individual rendering or `gl_Instance_ID` (if the number of instances is not too high) instead?

**Tags:** opengl


---

## 1 answers

### Answer by username_1 on 2020-11-01. Score: 2 | Accepted answer

If you need to update data, then you need to update data *regardless* of the mechanism you use to render the object. If you have 3000 objects to be rendered, and each frame they will be rendered with a different matrix transform, then you will have to send 192,000 bytes of memory (64-bytes-per-matrix) every frame. Whether explicitly through a write to buffer object storage or implicitly through setting uniform values, 192,000 bytes of data are going to have to find their way from CPU-space to GPU-space.

So long as you use reasonable [buffer object streaming techniques](https://www.khronos.org/opengl/wiki/Buffer_Object_Streaming), performance due to sending data shouldn't be a problem relative to other ways to send the data. Especially for fairly small data like per-model transforms. Of course, good buffer streaming does require having two buffers, but that's a memory storage tradeoff, not a runtime performance cost.


---

