# Buffering geometry in Webgl

**URL:** <https://discourse.processing.org/t/buffering-geometry-in-webgl/21030>\
**Category:** p5.js\
**Created:** [May 18, 2020, 9:44pm UTC](https://discourse.processing.org/t/buffering-geometry-in-webgl/21030 "2020-05-18T21:44:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vheun](https://avatars.discourse-cdn.com/v4/letter/v/51bf81/32.png) [@vheun](https://discourse.processing.org/u/vheun)\
**Post date:** [May 18, 2020, 9:44pm UTC](https://discourse.processing.org/t/buffering-geometry-in-webgl/21030/1 "2020-05-18T21:44:49Z")

</div>

I try to build some more performance demos that need to redraw a chain of multiple 3D geometries that are all identical.

Is there a way to buffer a geometry with p5js and just tell webgl to redraw a buffered shape? That would speed up the entire process a lot.

Thank you for your answers in advance.

---

<div class="post-metadata">

**Author:** ![Sven](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sven/32/8293_2.png) [@Sven](https://discourse.processing.org/u/Sven)\
**Post date:** [May 19, 2020, 5:12pm UTC](https://discourse.processing.org/t/buffering-geometry-in-webgl/21030/2 "2020-05-19T17:12:57Z")

</div>

Hello @vheun,

I think that’s already the case, at least for primitives. From [webgl\_mode\_architecture.md](https://github.com/processing/p5.js/blob/master/contributor_docs/webgl_mode_architecture.md):

> Caches geometry for 3D primitives (in retained mode), with the exception of shapes created with begin/endShape, which are dynamically generated and pushed to GL every time one is drawn (in immediate mode).

---

<div class="post-metadata">

**Author:** ![vheun](https://avatars.discourse-cdn.com/v4/letter/v/51bf81/32.png) [@vheun](https://discourse.processing.org/u/vheun)\
**Post date:** [May 19, 2020, 7:54pm UTC](https://discourse.processing.org/t/buffering-geometry-in-webgl/21030/3 "2020-05-19T19:54:33Z")

</div>

Yes I realized that after some more digging. Thank you!
