This year's GHP campus, Berry College, had a lot of cobblestone walkways, so I wanted to try to figure out how to generate passable cobblestone textures. My first thought was a Voronoi diagram, but the basic form seemed wrong. Cobblestone has mortar bits in-between the stones, while a Voronoi diagram has all the "stones" right up against eachother.
The actual shapes of the Voronoi polygons are about right (the cobbles at Berry were more angular), but there needed to be more separation between them. I thought for a while about how to accomplish that. The solution soon hit me. The mortar shows up on the edges of the Voronoi regions. How do you mathematically describe those points? To help answer that question, let's look at a small Voronoi diagram. (The little dots are the seeds.)
If we highlight the regions that should be mortar, it'd look something like this:
If you look carefully, you should notice that the mortar regions are almost equidistant from the points around them. So if, when you paint out the Voronoi stuff, you make all the regions that are almost equally close to two points, you get...these!
I realized that the empty spaces are caused when two seeds are too close together - so close that they cancel eachother out, making large seas of mortar. So, add in a culling process where all points too close together are removed, and you get this!
Number of Points: Threshold Distance: Culling Distance:
Feel free to mess around with this and use the resulting images for whatever. (Please drop me a line if you do, though.) I recognize that the colors are pretty unrealistic, but I'm not sure how to realistically generate stone textures. Perhaps that'll be a project for another day.
Back to Blog Index