Patchwork style render

Hey JGO (long time no see!),

I’m trying to figure out how i can generate some kind of ‘patchwork’ style pattern image that will be infinite.

Kind of like this picture except each field would be a totally different colour

http://vrap.co.uk/760_wm.php?src=img/760_4391.jpg&p=86

I’ve looked into Voroni diagrams but an infinite implementation, although seemingly possible, strike me as inefficient and not very mathmatical.
Perlin Noise doesn’t really do the job either, as this would make it more likely for certain colours to be connected which I don’t want, I want complete randomness.

Any ideas on the best way to go around this?

Why do you think you need to generate an infinite terrain? Just use your location as a random seed, that way your terrain will always be the same in the same location, but you don’t have to keep an infinite terrain in memory… which is impossible.

You can get some seam-like properties out of perlin/simplex noises with absolute value: http://www.java-gaming.org/index.php?topic=34560.0
You could then use a thresholding flood fill to color in the pieces.

Yes, I don’t need it to be generated, mistake in the question

The only issue with this method, is it leaves gaps in between each one, I want seamless transitions like a Voroni diagram

You should take a look at this: https://www.shadertoy.com/view/Xd23Dh
Non-so-efficient Java implementation (by me) here: https://gist.github.com/Longor1996/64ca31a25286470e3730

Sir, You Are Being Hunted has very similar generation to what you are trying to achieve.
I would look into these links explaining how they do it:


I’m not sure how much these will help as I haven’t read them myself, but its worth taking a look.

What exactly is your question then? You can achieve this by using your location as a random seed to generate a Voronoi diagram.

Yes! This seems to be exactly what I was looking for, I did some research into ‘Voronoise’ on google will try and implement that! Thanks a lot!

So I tried out the Voronoise function, its working pretty well :

Just the issue is that I’m getting colour changes at the edges of each ‘polygon’. It’s workable, but I would prefer not to have them, any suggestions on how to fix this?

Go and find out what values the voronoise function gives you at these ‘edges’, then try to ‘if them out’.

Thanks for all your help and suggestions, I’ve decided to revert the idea and just use Perlin Noise instead! Thanks anyway!