http://docs.unity3d.com/ScriptReference/Mathf.PerlinNoise.html It is said to return a value between 0 and 1 while I found that they return values larger than 1. The largest value I have seen is 1.0123. This is my code. zFrequency and xFrequency are both 40. Code (CSharp): void GenerateAlphaMap() { float[, ,] maps = terrain.terrainData.GetAlphamaps(0, 0, terrain.terrainData.alphamapWidth, terrain.terrainData.alphamapHeight); for (int y = 0; y < terrain.terrainData.alphamapHeight; y++) { for (int x = 0; x < terrain.terrainData.alphamapWidth; x++) { float perlinValue = Mathf.PerlinNoise(x / zFrequency, y / xFrequency); if (perlinValue > 1) { Debug.Log(perlinValue + " at " + x + ", " + y); } } } }
Hi @revolute, thanks for your feedback. However sounds more like a bug in the API, rather than in the documentation, if it can return values above 1. For now I assume you just ignore values higher that 1 (using Max() or similar methods)? I will suggest that you report this as a bug using Help -> Report a Bug in Unity including a good repro case. (don't know if the one above can be sent to us) Best regards, Rasmus