WebGPU MRI Raycast Engine — Real-time Brain Reconstruction in the Browser


Hey everyone! I’ve been building a WebGPU-based volume raycast engine for the past 8 months and wanted to share it here.

It features full tissue segmentation to reconstruct 3D brain replicas from MRI scans, running at ~100fps on integrated Intel graphics (Core i3 13th Gen).

Technical highlights:

  • Pure WebGPU compute shaders — no Three.js abstractions, built from scratch

  • Parallel reduction loops for volume traversal

  • Tissue segmentation pipeline running entirely on the GPU

:link: Live demo: https://webgpu-mri.vercel.app/
:open_file_folder: Repo: https://github.com/Bahdmanbabzo/webgpu-mri

Curious how it performs on higher-end GPUs — drop your specs and FPS if you try it! Open to suggestions and contributions.I write technical articles on various low-level GPU optimisation techniques on topics like memory alignment, compute shaders and parallel reduction on my medium, so please check it out and follow if you find it interesting!

1 Like

This looks pretty dope. What is the resolution of this scan? How high can it go?

Thanks! The resolution of this 3d volume is 256x256x176. The max I’ve tried to render was 450x450x150 without my PC freezing. Higher specs PCs might be able to reach much higher for more detailed scans.

1 Like