FWIW the rainbow link gives this console error in Firefox on a Surface Book with Intel graphics:
Uncaught TypeError: rgHalfFloatLinear is null
I assume that means it doesn't support 16-bit float pixel formats; maybe this is something that could be detected and shown as an error message in the page?
The original HN link works great, though, very cool!
Ahh that's a shame, yeah looks like 16-bit float textures aren't supported but 32 bit are. Thanks for the heads up – I should really be checking if either are supported here!
Similar implementation from a physics perspective – Pavel uses the same technique for simulating Navier–Stokes (Jo Stam Real-Time Fluid Dynamics for Games [0]). Pavel's has an extra step to enhance vorticity which gives you those higher detail swirls and uses a slightly different approach for input
The big difference is in the rendering however, Pavel has added light shafts and bloom which are really neat effects. Additionally, he actually got round to publishing a native app which I think has been great for him!
The technique is called "sine puke", and it works by starting with a gradient (in this case a rainbow) and warping the domain when drawing that gradient by sine functions repeatedly (check the for loop)
In the fluid demo I blend new frames with the previous so you get this slower, softer pattern
The original HN link works great, though, very cool!