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
function setup()
i = image(2,2)
for x = 1, 2 do
for y = 1, 2 do
i:set(x,y,math.random(255),math.random(255),math.random(255),255)
end
end
end
function draw()
background(40, 40, 50)
scale(300)
sprite(i,1,1)
end
I didn’t use noise and scaled it up a ridiculous amount.
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.