hi why my terrain is minecrafty ,i used terrain.party and gimp
I found that if I tried to import .png as “rgb 16bit”. This would result in stepped terrain.
You have to import your .png as" r 16 bit".
The problem is if you then try to use the terrain tools function to generate your terrain it will look really flat. To get around this you need to make a script that generates your terrain (see below) from the “r” value of the texture not the grayscale.
public class TerrainGenerator : MonoBehaviour { public Texture2D heightMap; public float depth; public float width; public float length; private bool terrainGenerating;
public void Update()
{
if (ControllerInput.NKey() & terrainGenerating == false)
{
StartCoroutine(GenerateTerrain());
}
}
public IEnumerator GenerateTerrain()
{
terrainGenerating = true;
Terrain terrain = GetComponentInChildren<Terrain>();
TerrainData tData = terrain.terrainData;
terrain.Flush();
tData.heightmapResolution = heightMap.width;
tData.size = new Vector3(heightMap.width, depth, heightMap.height);
float[,] heights = new float[heightMap.width, heightMap.height];
for (int y = 0; y < heightMap.width; y++)
{
for (int x = 0; x < heightMap.width; x++)
{
heights[x, y] = heightMap.GetPixel(x, y).r; //as opposed to heightMap.GetPixel(x, y).grayscale;
}
}
tData.SetHeights(0, 0, heights);
tData.size = new Vector3(width, depth, length);
terrainGenerating = false;
yield return null;
}
}