Moved steepness calculation
This commit is contained in:
@ -123,12 +123,7 @@ public class TerrainGeneratorScript : MonoBehaviour
|
||||
float height = map.GetHeight(ix, iy);
|
||||
|
||||
// Get steepness
|
||||
int safex = (ix == 0) ? 1 : ix;
|
||||
int safey = (iy == 0) ? 1 : iy;
|
||||
|
||||
float dx = map.GetHeight(safex - 1, safey) - height;
|
||||
float dy = map.GetHeight(safex, safey - 1) - height;
|
||||
float steepness = dx * dx + dy * dy;
|
||||
float steepness = map.GetSteepness(ix, iy);
|
||||
|
||||
// Go through each texture layer
|
||||
float[] weights = new float[terrainData.alphamapLayers];
|
||||
|
Reference in New Issue
Block a user