- Home /
Any way to create wrapping Perlin Noise using Mathf.PerlinNoise()?
I'm experimenting with a procedural terrain system using Perlin Noise, using the Mathf.PerlinNoise() function. However, I wanted to try wrapping it around a sphere to make planets, and I'm not sure there's any good way to generate seamless perlin noise using this function.
Anyone have any suggestions? I suppose I could try writing my own noise function, but to be perfectly honest I have a very difficult time understanding the math behind it.
Answer by rageingnonsense · Apr 30, 2015 at 10:19 PM
Unity's built in perlin noise is insufficient for most things I find. For the planets I generate, I use LibNoise to generate a sphere projected noise map. The UV map of your mesh needs to match the type of projection you use for your noise map.
LibNoise is quite slow though, so I would experiment with other noise libraries (I hear Accidental Noise Library is a good one). Bottom line though is you should not bother with Unity's built-in perlin; it just is not powerful enough. Perlin is only one type of noise, and for good looking terrain, you are going to want other types of noise; like fractal and billow.
As an aside, I strongly suggest you consider using a subdivided cube, that you pre-chunk into individual mesh objects in your modeling software, and convert to a sphere as a post-process, or at run-time (very simple; just vector.normalized * RADIUS for each vertex). I spent 6 months of my life on doing this exact thing, and the first thing I learned is that a single, standard sphere is just the wrong way to go for so many reasons. Easier UV mapping, and less obvious artifacts at the poles are just a few of the benefits of using a cube.
You'll want to pre-chunk it as well to get around the 65535 vertex limit. Otherwise you wont have very good detail unless your planet is very very small and cartoony.
Your answer
![](https://koobas.hobune.stream/wayback/20220613194410im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
UV Mapping. How can one point appear in multible places? 1 Answer
TextMesh Pro, indent line that is wrapped. 1 Answer
Help With UV Mapping 1 Answer
Breaking text line in GUI.Box 1 Answer
'Wrapped world' effect with 2 cameras? 2 Answers