WebHeat approximates the heat diffusion partial differential equation to calculate how objects change temperature. It builds a discretized space around a 3D model, breaks it into voxels, and assigns each voxel the material properties of the object if the model intersects it — otherwise the ambient properties. Those voxels are then stepped through time on the GPU, and the temperatures are drawn onto the model's surface as a color heatmap.
Highlights
Finite-difference heat diffusion solved in WebGPU compute shaders over a voxelized domain
Voxel size is tunable — smaller voxels trade memory for accuracy
All WebGPU graphics and compute live in plain JS behind a SceneManager class, exposed to React through a global ref so re-renders never recreate GPU devices
Heatmap sampling steps one voxel inward along the surface normal to avoid reading ambient cells at the model boundary