I would like to generate a tileable texture with the built-in noise function.
Anyone know if it is possible to “tile” the noise so that no seams are visible, some magic factor maybe ?
I looked up some stuff but I cannot make anything convincing out of it using the built-in function
You could use noise on a sprite and scale it up.
i = image(2,2)
for x = 1, 2 do
for y = 1, 2 do
background(40, 40, 50)
I didn’t use noise and scaled it up a ridiculous amount.
@Ipad41001 - that’s very smart, and it will do fine for now
Thanks a lot,
Have you tried a power-of-two sized array/image? I read somewhere that that’s supposed to make the resulting perlin noise seamlessly tileable.
Not seamless, but it will make the texture repeat when the texture coordinates exceed 1 or are less than 0. For example:
(0,5) -------------- (5,5)
(0,0) -------------- (5,0)
A rectangle with the above texture coordinates (on a mesh), using a power-of-two texture, will repeat 5 times. A non-power-of-two texture will not repeat and will instead clamp the border’s pixel colours.
@Xavier Not quite what you’re after, but the ‘draw a road’ code I posted the other day generates a noisy texture, and could perhaps be repurposed and tiled using the technique @Simeon suggested.