This should also be possible with other grids, right? Like hexagons for example.
Also, I wonder if this could be combined with Wang tiles somehow, especially the animated part!
https://en.wikipedia.org/wiki/Wang_tile
To partially answer my own question: if we want to use Wang tiles with Voronoi tesselation, what we'd need is to create a Voronoi tile for each central tile in a 3x3 "neighborhood" of Wang tiles.
I did a back-of the envelope calculation to see how many neighborhoods that would be. Let's say we use a complete set of two-color Wang tiles (so sixteen), which is the easiest/"smallest" set to work with. In that case we turn out to already have a whopping 16,777,216 grid combinations. Bit too much to generate all possible Voronoi tilings exhaustively, I'd say :p.
However, if we're filling in an NxM grid in advance, we'd only have to look at the much smaller subset of 3x3 neighborhoods within that grid. It should be doable to generate all the tiles that way and then tesselate them.
More thoughts: alternatively, instead of default edge tiles one could use corner tiles, and make the (probably fine) assumption that only adjacent corners affect the central tile. In that case we'd only have to generate 16 combinations of generators. However, the result will also look a lot more regular than the edge tile version. To mitigate one could go up to three colors, which increases the number of possible corners to 81
http://www.cr31.co.uk/stagecast/wang/2edge.htmlhttp://www.cr31.co.uk/stagecast/wang/2corn.htmlhttp://www.cr31.co.uk/stagecast/wang/3corn.html
... I should fork this notebook and give this a go, shouldn't I?
There's apparently a lot of garbage collecting happening here. I should probably pipeline the kernels to avoid copying textures between GPU and CPU, and back to GPU...