using-heightmap-for-terrain-creation

Questions & AnswersCategory: Generalusing-heightmap-for-terrain-creation
hlwerschner asked 1 year ago

Hi, I am new to uTerrain and have 2 questions for a start, after following the introductory videos: 1/ It is mentioned that I can use heightmaps to create a terrain. How do I do that and can I find documentation for the process? 2/ I have a unity terrain which I want to replace by a voxel variant with the same heightmap. Can I use the terrain gameobject as a defining mesh for the \”heightmap\” to achieve the same surface (so that all models placed on that mesh are also placed  properly on the voxelized plane).

2 Answers
hlwerschner answered 1 year ago

Thank you for the fast answer. Regarding 2/ … I only want to use the terrain plane mesh instead of a heightmap. Details are not needed (no grass, no trees etc). just the plane …
 

uTerrains Staff answered 1 year ago

Hi!
1/ get a look at the example scene called “heightmap”. Open the biome editor (click on edit biome in the inspector) and you will see a 2D generator that uses a heightmap to generate the terrain.

2/ unfortunately, importing trees and details from Unity’s terrain is not supported yet.

hlwerschner replied 1 year ago

1/ Ah yes, I could find this biome and found the linked heightmap to be a file of type “png”. I seems that the software ONLY ACCEPTS files of that format ? When I do an export of a Unity terrain I get a file of format “raw” which can easily used in PS and most of the internet msgs about heightmap refer to this file format. So my problem is that I can save a raw file heightmap in PS with file format PNG (greyscale 8 bit) but uTerrain will not accept it, but complains with

Texture ‘terrain-2raw’ is not readable, the texture memory can not be accessed from scripts. You can make the texture readable in the Texture Import Settings.
UnityEngine.Texture2D.GetPixel (System.Int32 x, System.Int32 y) (at C:/buildslave/unity/build/Runtime/Export/Texture.cs:382)

I can not interpret the meaning of this message. Please help me understand what is expected here.

uTerrains Staff replied 1 year ago

I think you just need to enable Read/Write on your texture (your heightmap). Click on it and get a look at its import settings.