Anybody reading my other threads lately know that I have been researching a way to pack circles as dense as possible to achieve a procedural texture node able to make random patterns with images.
My initial goal was to make a procedural texture like this:
The above picture is harder to create than I initially thought. The best way to do it I have found out is to randomise spheres on a plane, starting large, and sequentially randomise smaller and smaller circles. Whenever a circle overlaps another, skip it. However, this method does not work with a OSL shader, since the shader needs to be calculated for every pixel over a surface. Also this method required collision detection on all circles whenever a new one is sampled.
An optimal outcome would be something like this:
(Handmade “random” circles made by artist Yayoi Kusama)
Instead I have experimentet with voronoi-distributions, where you only have to “re-create” a part of the texture close to the point you are sampling. So for example If the point you are sampling is close to the top left border, you only have to create the circles covering that area, and so on. This becomes a problem though, because all circles should touch, a random sized circle in the bottom left corner could potentially alter a position of a circle in the top right corner (!).
Also, im not rendering textures, but rather vectors as colors. This enables me to use any texture for a circle or as in my sample a 10x10 texture sample, that will use each square for a unique circle.
I will keep this thread as to present my results.
So far this is what I got
(after two weeks of research, this is a voronoi distribution, where any overlapping is adjusted by shrinking the circle)
As one can see this is not as dense as Kusama’s circles. Lots of gaps. I will post my findings here. Any suggestions (except “stop trying” or do it outside the OSL-shader) is welcome.