With the code below I am generating a canvas full of noise. I would like this noise to be resolution agnostic. (appear visually the same at all resolutions) - The code below provides this, but the noise which is pulled from Rune Madsens's Noise seems to tile.
Can anyone suggest a way that I might make it less of an obvious repeating pattern, yet still keep it looking the same at all resolutions.
let grain_index = 0;
let grain_scale = 0.0025;
for (let ypos = 0; ypos < rd.canvas.height; ypos++)
{
for (let xpos = 0; xpos < rd.canvas.width; xpos++)
{
let samplex = xpos / (rd.canvas.height * grain_scale);
let sampley = ypos / (rd.canvas.width * grain_scale);
let samplez = 0;
let lum = rd.noise.get(samplex, sampley, samplez) * 255;
grain_imagedata[grain_index + 0] = lum;
grain_imagedata[grain_index + 1] = lum;
grain_imagedata[grain_index + 2] = lum;
grain_imagedata[grain_index + 3] = 96;
grain_index += 4;
}
}