Liquid Drop Simulation on Raspberry Pi 4

Опубликовано: 17 Июнь 2026
на канале: Nick Venanzi
37
1

Ported original fluid simulation code onto a Raspberry Pi Model 4 (Broadcom BCM2711 SoC, with a quad-core ARM Cortex-A72 CPU and a VideoCore VI GPU).

1. Rewrote all the OpenGL code to use Vulkan (tedious but worth it)
2. Expanded grid size to 40x40x40 (from 10x10x10) - signed up for major tuning efforts mentioned below
3. Implemented Marching Cubes algorithm to convert signed distance field (each point in grid knows how far it is from fluid surface) into a surface reconstruction. Original code used marker cells (not very interesting visual)
4. Moved as much of Navier-Stokes solver onto GPU. Very fast.
5. Performance tuned what was left (easy to do when original code was written with no understanding of how hardware works. This was the most fun. Mostly perf and valgrind.
6. To-do: Use GPU profilers for finer tuning of GPU kernels.