- Home /
How exactly is Perlin Noise implemented?
I'm just starting to get my head around Perlin Noise and how it works. Now that I have created the function, how could i use that to create a height map? And even if i figure that out, how does one make the blocks in positions according to that height map?
Or am I completely seeing this wrong? Is perlin noise used to generate the height map, and then the height map is used to generate the terrain, or is the terrain generated straight from the values given my the perlin noise function?
(Yes I want something Minecraft related, I know people have asked before but I haven't found an answer to these specific questions. Any help would be greatly appreciated! )
so i can have a pseudo random number generator for terrain, textures, etc. The issue is (besides the fact that my current perlin noise function isnt working) that i dont know how to implement it when creating procedural terrain.
I think you are looking for something like this : http://answers.unity3d.com/questions/133941/Creating-Cubes-with-Jagged-Edges.html
or here : http://answers.unity3d.com/questions/298703/perlin-noise-continuous-through-different-objects.html
Answer by Bunny83 · Aug 22, 2012 at 12:19 AM
You want an example for a Minecraft like terrain generator? Just take a look at the Minecraft starter package for Unity. It contains all you need.
Answer by ScroodgeM · Aug 21, 2012 at 10:10 PM
main way perlin noise implemented is to generate SAME noises on different targets. for example, to cover some surface without using a texture and be sure that this surface will look same on every generating and on every client it generates.
so in your case you can use simple UnityEngine.Random to got all randomization you need. heightmap, box placing, painting etc - just write algorithms to apply random to your world
So how would one generate block terrain with for a given PerlinNoise function? Or a heightmap?
Answer by BeShifty · Aug 21, 2012 at 10:46 PM
Your boxes will have x and y coordinates. Since most perlin noise functions take 1 parameter, use some hash function that takes your x and y values and then pass the hash to the perlin noise function. This will give you a height. Unfortunately, the heightmap isn't going to be very smooth, so you should do some interpolation and smoothing of the nearby values. This article explains that process fairly well (see the paragraph "2-dimensional Smooth Noise").
That's the article I use for my perlin noise functions. I have two PerlinNoise functions, one for 1D, and one for 2D. (as in the article) What I don't understand is how to implement it to create a heighmap or $$anonymous$$ecraft-like terrain.
I may be being unclear, so let me re-phrase my question. Can I have a code example or explanation of how to create $$anonymous$$inecraft-like terrain using a perlin noise function (2D noise function).
Answer by MountDoomTeam · Jan 19, 2013 at 10:48 AM
http://answers.unity3d.com/questions/188721/creating-perlin-noise.html#answer-383517 ^^ those are tests i just did on the unity perlin function. image and distribution data. see end of thread.
Your answer
Follow this Question
Related Questions
Perlin noise for (sort of Minecraft) terrain generator 2 Answers
Minecraft-like ore generation 1 Answer
Add perlin noise to blocky terrain 0 Answers
Random Terrain Generation (Trees, Details, Textures) by passing a Seed? 0 Answers
How would one approach tile-by-tile terrain generation with Perlin Noise? 0 Answers