WebGPU Compute shaders support

Hello,

Would it be possible to port this kind of code to Three.js:

A simpler example would be an extension of the WebGPU / Compute Particles Three.js example to compute in real-time on the GPU the number of points with a velocity > EPSILON and display it in the GUI. Another benefit would be to avoid rendering the scene if no particles are moving and the user is not interacting with orbit controls, potentially achieving massive energy reduction if left open in the background.

From my understanding, it would involve using wgslFn, but before diving in and spending time on it (I am quite new to this topic), I would like to know if the complex operations described are feasible and compatible with:

  • Creating read/write buffers
  • Workgroups
  • workgroupBarrier

Thanks for the help