- Home /
Perlin Noise for 3d Voxel Terrain
Hi, I am trying to make a procedually generated 3d voxel terrain, i googled this alot an i still don´t understand Perlin Noise, the math behind it, how to appy it to the 3d Terrain and making it procedually, for example if i generate a Chunk, how to make the chunk next to it be a contination of the terrain.
Any libreries or explanaitions are really apreciated.
Should I use Mathf.PerlinNoise or external libraries?
Thank you
EDIT: ok so now i got this so far
for (float px = 0; px < 16; px ++) {
//Our Y
for (float py = 0; py< 16; py ++) {
//1 valor juntez, 2
float Perlin1 = Mathf.PerlinNoise(px/80, RX);
float Perlin2 = Mathf.PerlinNoise(py/80, RY);
Color newColor = new Color( Random.value, Random.value, Random.value, 1.0f );
pos = new Vector3(py-PY, Perlin1*90*Perlin2, px-PX);
GameObject Block = (GameObject)Instantiate(terraincube, pos, Quaternion.identity);
Block.transform.parent = Container;
Block.name = "Block";
Block.renderer.material.color = newColor;
}
}
I got this code from a forum post I edited it a bit to fit what i need, also it was in UnityScript.
It generates mountains or plains,t proe this is what i need but i dont know how to make it procedually, like Chunk 1 continous CHUNK 2.
Also if anyone founds the exact link for download a librery with an easy way to implement perlin noise to the terrain i would really aprecciate it.
EDIT:
I found this library Which i thought i could be very useful until i did not found a way to implement this Noise to a Voxel Terrain, Anyone has any example script on how to apply it. Or the explanation. This things would be really apprecciating. So Please if you have any infomation you would like to share with me Thank you.
I don't know if you are already folowing this tutorial, but if you aren't, it might help. Good Luck!
yep I already follow that tutorial but u i didnt like like the results.Because i dont want a copy of $$anonymous$$ecraft generation. I want a base to make my on voxel terrain, an example on how to implement it.
This is only really a partial answer, but since there are tons of noise libraries out there, I don't think that will be much of a problem. You said that you needed chunks to be continuous. What I do for this is rather than using the chunk coordinates of the voxel, I convert them into world coordinates based on the transform of the chunk, and use those. This has the added advantage of keeping your terrain features the same size and orientation even if you rotate or scale chunks.
Also, as a side note, it looks like you are instantiating block objects. These are not voxels, which are hypothetical points used to generate a procedural mesh for the chunk. If this is what you are doing, I suggest you do some further research on voxels, because this is probably not what you want. If this isn't what you are doing, or you are doing this on purpose, then go ahead, but I have seen a lot of people trying to implement "voxels" this way and running into some serious (mostly performance-related) issues.
Answer by flaviusxvii · Feb 21, 2014 at 06:47 PM
CoherentNoise Gives you much more power than Mathf.PerlinNoise. It's based on Simplex noise, which is a more efficient and superior method.
how to make the chunk next to it be a contination of the terrain
This is automatic if the inputs you give to the noise functions are continuous.. like x, y world space positions are continuous through space.
Thanks, This is what i needed, I am reading the manual now, but i cant find the exact asset store download link.
This is the link in the forums.
http://u3d.as/content/chaos-cult/coherent-noise/1Uc
And it redirects me to the home page of the asset store.
you seem to know all about noise ;)
can you help me : https://forum.unity.com/threads/help-infinite-3d-terrain-generation.905237/?_ga=2.63223983.1250403939.1591275441-1381476373.1575735906
iknow this is an old thread, but im really stuck!
Your answer
Follow this Question
Related Questions
[BEGINNER] Generating Terrain with Perlin noise flat and nothing happens ? 1 Answer
2D Efficient Realtime Terrain Generation 0 Answers
3d Perlin Noise? 3 Answers
How can i use perlin noise to create better world? 0 Answers
Terrain help 0 Answers