How would I make blobs of color and not pixels with perlin noise?

Hi, I’m experimenting with Perlin noise and a tile map. I wanted to make terrain generation on a tile map with Perlin noise and when doing so, the results are not what I expected. I was going for blobs of color on the tilemap but the tilemap looks more random then smooth pseudo-random displayed in the image.


I have no experience with Perlin noise, so I googled what I could do, and there weren’t too many resources about it. I thought the amplitude could affect it but it didn’t affect it and changing the scale values where 0.1 seems to be the best option. Any suggestions will help a lot.

My script:

    local tiles = workspace.Tiles:GetChildren()
    local Scale = .01
    local amplitude = 1
      --Math Noise Generation
    for i, tile in ipairs(tiles) do
    	print(i)
    	local Noise = math.noise(i*Scale,i*Scale,i*Scale)*amplitude
    	tile.noiseValue.Value = Noise
    	if Noise > .2 then
    		tile.BrickColor = BrickColor.new("Cyan")
    		tile.Material = Enum.Material.SmoothPlastic
    	end
    	print(Noise)
    	wait()
    end
1 Like

Try changing local Noise = math.noise(i*Scale,i*Scale,i*Scale)*amplitude to local Noise = math.noise(tile.Position.X*Scale,0,tile.Position.Z*Scale)*amplitude.

1 Like

What you are looking for is called octaves. Each octave is a layer of Perlin noise. The octaves work together with the lowest layer adding slight offsets to each pixel while each value in the higher octaves affect large groups of pixels very strongly. The smallest octave possible has 1 value per a pixel, while the single value in the largest octave possible determines the color of all pixels. This allows the image to have large regions that are a specific color, and each region is subdivided into more regions with slightly different color. However, since the larger octaves affect the value of each pixel in a group more than the lower octaves, you get groups of pixels that are similarly colored.

I also described noise in this response to a question about terrain generation:

Here is a good article describing how to use Perlin noise:
https://flafla2.github.io/2014/08/09/perlinnoise.html

1 Like

In this part:

    for i, tile in ipairs(tiles) do
    	local Noise = math.noise(i*Scale,i*Scale,i*Scale)*amplitude
    end

…you’re passing the same coordinate to each dimension of math.noise, which is fine if you only want 1D noise. It seems like you want 2D noise though? You’ll want to use the X and Z coordinates of the “tiles” instead of their place in a list. E.g.:

    for i, tile in ipairs(tiles) do
    	local Noise = math.noise(tile.Position.X * scale, tile.Position.Z * scale) * amplitude
    end