Я рекомендую написать функцию, которая отображает плитку шума в PGraphics
объект:
PGraphics CreateTile(int w, int h, float scale)
{
PGraphics pg = createGraphics(w, h, JAVA2D);
pg.beginDraw();
for(int x = 0; x<w;x++){
for(int y = 0; y<h;y++){
float col = 255*noise(scale * x, scale * y, 30 * scale * frameCount);
pg.set(x, y, color(col));
}
}
pg.endDraw();
return pg;
}
Затем вы можете размещать плитку так часто, как вы хотите:
void draw(){
background(0);
int w = 300;
int h = 300;
PGraphics pg = CreateTile(w, h, 0.01);
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
image(pg, w*i, h*j);
}
}
}