# How can I efficiently render 1 billion cubes in VTK.js?

**URL:** https://discourse.vtk.org/t/how-can-i-efficiently-render-1-billion-cubes-in-vtk-js/15724
**Category:** Web
**Tags:** vtkglyph3dmapper, vtkjs
**Created:** [June 11, 2025, 5:12am UTC](https://discourse.vtk.org/t/how-can-i-efficiently-render-1-billion-cubes-in-vtk-js/15724 "2025-06-11T05:12:51Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Amit\_Bhakar](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amit_bhakar/32/10076_2.png) [@Amit\_Bhakar](https://discourse.vtk.org/u/Amit_Bhakar)
#### Post date: [June 11, 2025, 5:12am UTC](https://discourse.vtk.org/t/how-can-i-efficiently-render-1-billion-cubes-in-vtk-js/15724/1 "2025-06-11T05:12:51Z")

</div>

Hi all,

I’m working on a web-based 3D visualization using **VTK.js** , and I need to render a **very large number of cubes** — on the order of **1 billion**. I’m looking for suggestions or best practices on how to handle this efficiently in the browser.

So far, I’ve tried approaches using `vtkGlyph3DMapper`, but I’m hitting performance and memory limitations long before reaching that scale. Are there any techniques in VTK.js (or WebGL generally) that can help me to achieve that.

Has anyone successfully visualized data at this scale in VTK.js, or is this better suited for native VTK?

Any advice or pointers would be appreciated!

Thanks in advance.

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [June 12, 2025, 9:49pm UTC](https://discourse.vtk.org/t/how-can-i-efficiently-render-1-billion-cubes-in-vtk-js/15724/2 "2025-06-12T21:49:23Z")

</div>

While not a cube, does the sphere mapper handle that scale? If so, something similar using some “fake cube” could do the trick.

---

<div class="post-metadata">

### Author: ![Amit\_Bhakar](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amit_bhakar/32/10076_2.png) [@Amit\_Bhakar](https://discourse.vtk.org/u/Amit_Bhakar)
#### Post date: [June 18, 2025, 6:48am UTC](https://discourse.vtk.org/t/how-can-i-efficiently-render-1-billion-cubes-in-vtk-js/15724/3 "2025-06-18T06:48:27Z")

</div>

Just to clarify — I’m working with **VTK.js** , where `vtkOpenGLSphereMapper` doesn’t exist. So I’m trying to find a way to replicate that performance in the browser.

When you mention the “sphere mapper,” are you referring specifically to `vtkOpenGLSphereMapper` in native VTK? If so, is there any known equivalent strategy or workaround in VTK.js.

I’d appreciate any guidance or examples if someone has already done something similar in VTK.js.

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [June 19, 2025, 7:11pm UTC](https://discourse.vtk.org/t/how-can-i-efficiently-render-1-billion-cubes-in-vtk-js/15724/4 "2025-06-19T19:11:58Z")

</div>

> **[vtk.js](https://kitware.github.io/vtk-js/examples/SphereMapper.html)**
>
> SphereMapperLive example Sourceimport '@kitware/vtk.js/favicon';// Load the rendering pieces we want to use (for both WebGL and WebGPU)import '@kitware/vtk.js/Rendering/Profiles/Geomet

---

<div class="post-metadata">

### Author: ![Amit\_Bhakar](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amit_bhakar/32/10076_2.png) [@Amit\_Bhakar](https://discourse.vtk.org/u/Amit_Bhakar)
#### Post date: [June 24, 2025, 9:11am UTC](https://discourse.vtk.org/t/how-can-i-efficiently-render-1-billion-cubes-in-vtk-js/15724/5 "2025-06-24T09:11:52Z")

</div>

I have tried with sphere mapper but still i am facing the performance issue at scale of millions only.
