A few days ago I've started researching 2D perlin noise and I've finally got that down, but in the process I've learned of 3D perlin noise generation, and after eventually getting a working script I've found it's very ill optimized
Here is an image of my 3D perlin noise
My problem is that I'm not sure how to remove the parts that wouldn't normally be seen by the player. How do I remove the parts within and make a shell like structure so my generated object isn't tens of thousands of parts?
Edit:
https://i.imgur.com/hpO30Ax.jpg
Here is an image I found of someone who has gotten the shell like effect I want
Another Edit: Here is the script I'd like some help on, nothing super fancy or never seen before.
local resolution = 50
local frequency = 10
local power = 20
local Seed = math.random(1, 500)
local MaxDensity = -1
local Block = Instance.new("Part")
Block.Anchored = true
Block.Size = Vector3.new(2,2,2)
for x = 2, resolution do
for y = 2, resolution do
for z = 2, resolution do
local X = math.noise((y/frequency),(z/frequency),Seed)*power
local Y = math.noise((x/frequency),(z/frequency),Seed)*power
local Z = math.noise((y/frequency),(x/frequency),Seed)*power
local Density = X + Y + Z
if Density < MaxDensity then
local Blocka = Block:Clone()
Blocka.Parent = game.Workspace
Blocka.CFrame = CFrame.new(x*2,y*2,z*2)
Blocka.Color = Color3.new(Blocka.Position.X*2,Blocka.Position.Y*2,Blocka.Position.Z*2)
end
end
end
end

3 comments
If you want us to help you with your script, you're going to have to provide the script...
Currently, the filled in areas would be represented by the influence vectors so use a unit vector to save a slice of the influence vector, and just don't fill in the rest. This would limit blocks to the blocks visible to players, including any caves and such.
How would I go about doing that rens321? I'm still pretty new to Lua.