# Making use of the GPU to render huge amount of objects

**URL:** <https://discourse.processing.org/t/making-use-of-the-gpu-to-render-huge-amount-of-objects/26267>\
**Category:** Coding Questions\
**Created:** [December 15, 2020, 12:23pm UTC](https://discourse.processing.org/t/making-use-of-the-gpu-to-render-huge-amount-of-objects/26267 "2020-12-15T12:23:46Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [December 17, 2020, 12:18pm UTC](https://discourse.processing.org/t/making-use-of-the-gpu-to-render-huge-amount-of-objects/26267/10 "2020-12-17T12:18:22Z")

</div>

The [`createGraphics()`](https://p5js.org/reference/#/p5.Graphics) function returns a `p5.Graphics` object which basically [stores a canvas](https://github.com/processing/p5.js/blob/1.1.9/src/core/p5.Graphics.js#L28).

And a canvas is a bitmap image under the hood but you can define your bitmap resolution to be different than the size of the html element of the canvas (so you can zoom into it).

If you want infinite zoom, you might want to use SVG which is vector based graphics. Unfortunatly it’s not supported in p5.js : [Render SVG in P5.js](https://discourse.processing.org/t/render-svg-in-p5-js/11935)

This is very well explained on the Wikipedia page :

> **[Canvas element |](https://en.wikipedia.org/wiki/Canvas_element#Canvas_versus_Scalable_Vector_Graphics_.28SVG.29)**
>
> SVG is an earlier standard for drawing shapes in browsers. However, unlike canvas, which is raster-based, SVG is vector-based, so that each drawn shape is remembered as an object in a scene graph or Document Object Model, which is subsequently rendered to a bitmap. This means that if attributes of an SVG object are changed, the browser can automatically re-render the scene.
> Canvas objects, on the other hand, are drawn in immediate mode. In the canvas example above, once the rectangle is drawn t...

---

_[View the full topic](https://discourse.processing.org/t/making-use-of-the-gpu-to-render-huge-amount-of-objects/26267)._
