# How to use GPU to accelerate time-consuming calculations, such as ImageMarchingCubes and WindowedSincPolyDataMilter

**URL:** https://discourse.vtk.org/t/how-to-use-gpu-to-accelerate-time-consuming-calculations-such-as-imagemarchingcubes-and-windowedsincpolydatamilter/16319
**Category:** vtk.js
**Created:** [March 6, 2026, 9:39am UTC](https://discourse.vtk.org/t/how-to-use-gpu-to-accelerate-time-consuming-calculations-such-as-imagemarchingcubes-and-windowedsincpolydatamilter/16319 "2026-03-06T09:39:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![MrQ\_92](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mrq_92/32/10552_2.png) [@MrQ\_92](https://discourse.vtk.org/u/MrQ_92)
#### Post date: [March 6, 2026, 9:39am UTC](https://discourse.vtk.org/t/how-to-use-gpu-to-accelerate-time-consuming-calculations-such-as-imagemarchingcubes-and-windowedsincpolydatamilter/16319/1 "2026-03-06T09:39:39Z")

</div>

I am learning to use vtk.js.  
The current issue is that the calculation of large volume data using MarchingCubes and WindowedSincPolyDataMilter is time-consuming.

I have read the code and found that their calculations are not on the GPU, so I am wondering if there is a way to use the GPU to accelerate these calculations.

Since I am not very familiar with the internal implementation of vtk.js, I tried to create a SmoothFilter that calculates on the GPU, but it seems to conflict with the original logic on the calculation queue, resulting in lag.

If I want to implement a GPU to run some calculations, is there any way to better integrate it into VTK.js

---

<div class="post-metadata">

### Author: ![MrQ\_92](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mrq_92/32/10552_2.png) [@MrQ\_92](https://discourse.vtk.org/u/MrQ_92)
#### Post date: [March 6, 2026, 11:28am UTC](https://discourse.vtk.org/t/how-to-use-gpu-to-accelerate-time-consuming-calculations-such-as-imagemarchingcubes-and-windowedsincpolydatamilter/16319/2 "2026-03-06T11:28:06Z")

</div>

test code:

> **[Comparing Kitware:master...qianlishun:gpu-calc · Kitware/vtk-js](https://github.com/Kitware/vtk-js/compare/master...qianlishun:vtk-js:gpu-calc)**
>
> Visualization Toolkit for the Web. Contribute to Kitware/vtk-js development by creating an account on GitHub.

> <https://github.com/qianlishun/vtk-js/commit/b0ddb778c3364f4a1b2eb185ee6a4657c8eed4a8>

---

<div class="post-metadata">

### Author: ![finetjul](https://discourse.vtk.org/user_avatar/discourse.vtk.org/finetjul/32/154_2.png) [@finetjul](https://discourse.vtk.org/u/finetjul)
#### Post date: [March 18, 2026, 7:21am UTC](https://discourse.vtk.org/t/how-to-use-gpu-to-accelerate-time-consuming-calculations-such-as-imagemarchingcubes-and-windowedsincpolydatamilter/16319/3 "2026-03-18T07:21:32Z")

</div>

If you want to do GPU computation on a mesh, you would need to use compute shaders.

We do not have any example in VTK.js.

For “rendering” processing on the GPU, you can look at this example: [Convolution2DPass | VTK.js](https://kitware.github.io/vtk-js/examples/Convolution2DPass.html)

---

<div class="post-metadata">

### Author: ![MrQ\_92](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mrq_92/32/10552_2.png) [@MrQ\_92](https://discourse.vtk.org/u/MrQ_92)
#### Post date: [March 23, 2026, 6:32am UTC](https://discourse.vtk.org/t/how-to-use-gpu-to-accelerate-time-consuming-calculations-such-as-imagemarchingcubes-and-windowedsincpolydatamilter/16319/4 "2026-03-23T06:32:09Z")

</div>

Thank you for your reply. I am trying to use createShaderModule createComputePipeline.

The delay issue mentioned earlier is due to the GPU not synchronously refreshing render() after completing the calculation. I just added a callback to fix it.
