Terrain To Mesh Conversion in TerraLand
TerraLand Terrain as part of the TerraLand is a multi-processor component to operate various terrain manipulation techniques over inserted terrains.
Currently, these operations are:
- NEW TERRAIN SETTINGS: Generate terrains out of user own custom elevation data regardless of the data resolution and defined number of terrain chunks using advanced re-sampling operations if needed
- TERRAIN NEIGHBORS: Sets the terrain neighbors for seamless Terrain System’s LOD & Tessellation if this data is lost some how
- TERRAIN SPLITTER: Splits a single terrain in a grid based form (like any available mapping solutions) into desired number of terrain tiles
- SMOOTHEN TERRAIN HEIGHTS: Smooths out inserted terrains and removes jaggies on them
- EXPORT ELEVATION DATA: Exports elevation/heightmap data from the inserted terrains in 2 formats of RAW & ASCII Grid file used by ESRI and many GIS applications
- IMAGE TILER: Takes a folder containing of terrain’s satellite image tiles and texture inserted terrains by these satellite images
- TERRAIN TO MESH: Converts inserted terrain(s) to 3D mesh in OBJ format to be used inside Unity or any other 3D modelling software
- MESH TO TERRAIN: Converts any inserted mesh object into terrain
- GEO-COORDINATES CONVERTER: Converts geo-coordinates between Decimal Degrees (DD) format and Minute, Degree, Second (MDS) format.
In TerraLand Terrain, like any other TerraUnity/TerraLand components, you input terrain(s) by dragging and dropping them into the Offline Data section of the UI for the existing terrains.
- So you simply need to insert a terrain object by dragging and dropping it from the Hierarchy into the “Single Terrain” slot
- Or a terrain parent object containing of terrain tiles by dragging and dropping it from the Hierarchy into the “Terrain Chunks” slot in this section to be recognizable by TerraLand.
Whenever any existing terrain object(s) are inserted in the Offline Data section, the info bar at the top changes color from Red to Green indicating that already generated offline data is available for processing as in the following image.
Now that you have desired terrain(s) inserted, you can do any of the operations introduced in the UI on your terrains (e.g. Terrain To Mesh).
The “NEEDS MESH IMPORTING IN PROJECT” is just a warning to the user which indicates that the generating terrain meshes will be imported into the project in order to be placed in the scene. This warning does not mean that there are any missing scripts or extra components needed.
As it takes a lot of time on higher poly meshes (sometimes millions of polygons) to be imported in Unity, users must be aware of that.
If you disable the “PLACE IN THE SCENE” option, this warning will go away and you can save an .OBJ mesh file from your terrain anywhere outside your project for later usage in any 3D modelling software or Unity.
The power of TerraLand’s “Terrain To Mesh” converter is that it can generate terrain meshes regardless of the number of input terrain(s) whether it is just a single terrain or a tile of 256 terrains for example. It can simply generate a seamless terrain mesh surface out of terrains.
The same behavior applies to other TerraLand’s processors and it works out of the box regardless of inserted data resolution and terrains’ number which makes it a powerful tool for terrain analysis and manipulation.
For testing proposes, we took a 2K terrain consisting of 4 terrain chunks stitched together and converted into 3D mesh objects through 16th, 8th, 4th, half and full resolution of the original data.
FYI, a terrain like this has more than 4 million polygons (2049 x 2049 = 4198401) to be processed.
Here are the results:
- At 16th Resolution: 1 mesh part with total of 32768 tris
- At 8th Resolution: 3 mesh parts with total of 131072 tris – (65534 x 2) + 4
- At 4th Resolution: 9 mesh parts with total of 524288 tris – (65534 x 8) + 16
- At Half Resolution: 33 mesh parts with total of 2097152 tris – (65534 x 32) + 64
- At Full Resolution: 129 mesh parts with total of 8396802 tris – (65534 x 128) + 8450
* Unity splits mesh models into sub-meshes due to 65535 vertices limit during the import.
As you see the generated 3D mesh converted from terrain objects have 8,396,802 triangles which is equal to half of the the previously mentioned original terrain’s 4,198,401 polygons holding a 2049×2049 heightmap in it.