You can run shaders like this in the browser, so you could probably start by directly lifting this code (and practicing in shadertoy)