Hi,
I’ve been working on a procedural terrain generator. I first create the heightmap than I apply it to a terrain data object. My problem is the following: I can’t seem to understand how to modify the heighmap.
private float[,] GenerateHeightmap(float[,] heightMap, Vector2 arraySize) //A flat heightmap is received here and the arraysize contains the x and y of the heightmap
{
for (int My = 0; My < arraySize.y; My++) {
for (int Mx = 0; Mx < arraySize.x; Mx++) {
heightMap[Mx, My] = (float)(Mx / 1000);//Because my heightmap is 513x513 I'm just making sure the value of heightMap[Mx, My] is under 1
}
}
return heightMap;
}
//After receiving the heightmap I do:
terData.SetHeights(0, 0, heightMap);
//I think everything should be running fine but it isn't.
The problem is that I don’t see any modifications on the terrain. Am I missing something?
At the moment I just want to modify the heightmap and see those modification in the terrain.
Plus, can anyone explain to me better why the range between 0 and 1 for the heightmap???
Thanks.