𝗪𝗲𝗯𝗚𝗣𝗨: 𝟮𝟱𝟬,𝟬𝟬𝟬 𝗣𝗮𝗿𝘁𝗶𝗰𝗹𝗲𝘀 𝗢𝗻 𝗬𝗼𝘂𝗿 𝗕𝗿𝗼𝘄𝘀𝗲𝗿

Today is day 50. It is the final day of my series building new tech from scratch every day.

I chose WebGPU to finish this series. WebGPU allows you to simulate 250,000 particles entirely on your GPU inside a browser.

Your CPU has a few fast cores. Your GPU has thousands of simple cores. To move 250,000 particles, a CPU works through them one by one. A GPU does thousands at the exact same time.

WebGPU is the modern successor to WebGL. It uses compute shaders to run general programs on your hardware.

How it works:

The compute shader runs the same logic for every particle at once. The data stays on the GPU. It moves from the compute step to the render step without leaving the hardware. This speed allows the simulation to run at 60fps.

WebGPU will become the foundation for in-browser machine learning and heavy computation. It is a vital tool for the future of web development.

Thank you for following this series. You can find the full archive of every project here.

Full code: https://github.com/dev48v/webgpu-from-zero

Complete post: https://dev.to/dev48v/webgpu-i-simulated-250000-particles-entirely-on-the-gpu-in-the-browser-2o0f

Archive: https://dev48v.infy.uk/techfromzero.php