Enjoy the show, or use the controls at the bottom to experiement with the fountains.
Web Worker Fountains are generating animation frames composed of particles (each water droplet) and sending them to the web page via postMessage() where they are composited onto a canvas. The main page buffers all the collected frames and draws them at each "requestAnimationFrame" interval.
Web workers can optimize fountain frame creation by working on pre-rendering frames while the main page is drawing the scene to the canvas and painting and rendering. Fountain frames with fewer water droplets can be rendered much faster than frames with lots of water droplets. By pre-rendering many frames, the cost-per-fountain frame is averaged over time, leading to smoother frame rates.
The overall frame rate of this demo depends on the performance of several subsystems:
When not using web workers to power the fountains, pre-rendering is disabled, and the main page takes on the additional work previously handled by the web workers.