Hello!
I am trying to generate a normal perlin noise texture
Example:
When I try to do it, I am continuously getting this:
I am so lost, because it either looks like what was described as “wood” by one resource I read, or it just looks like random noise:
I have determined that firstly, I cannot just use integers in math.noise
, so I must divide all of the coordinates going into the function by at least 10 so that they become decimals of some sort. I have also determined that the larger the number I divide by, the more it “zooms in”. I want it to zoom in a lot, but I don’t want me resulting texture to look like wood, I want it to look like the nice blurry noise from the first picture.
I am really struggling to understand why this is happening, as terrain generators use math.noise
and have no problems. Part of my research was trying to find a roblox-provided terrain generator script, because I remember one existing on the old developer hub, but it seems they deleted a lot of the tutorials since the switch, so I was unable to find that.
Help would be greatly appreciated. For context, here is my code:
My perlin noise “generator” function:
local function getPerlinValue(x: number, y: number?, z: number?)
y = y or 0
z = z or 0
return math.noise(x/10, y/10, PERLIN_SEED)
end
My “image” generator function:
local function generateImage()
clearPartFolder()
for x = -500, 500, 5 do
local f = Instance.new("Folder")
f.Name = x
for y = -500, 500, 5 do
createPart(Vector3.new(x, 50, y), Vector3.new(5, 5, 5), getPerlinValue(x, y), f)
end
f.Parent = partFolder
end
end
And for reference, my part creator function:
local function createPart(Position: Vector3, Size: Vector3, Color: number, parent)
local p = Instance.new("Part")
p.Anchored = true
p.Position = Position
p.Size = Size
p.Material = Enum.Material.SmoothPlastic
p.Color = Color3.fromHSV(0, 0, Color* 100)
p.Parent = parent
end
Thanks in advance!