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

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

test code:

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

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.

1 Like