Unity has ‘Terrain (Engine)’ to create a terrain as the base of VR space. However, it has a few problems. For example, it is so memory-intensive that it could slow down the Scene and it couldn’t be resized or rotated once it’s uploaded to STYLY.
So, this time, I will show how to separate the mesh and the texture of a terrain, reduce the size and upload to STYLY by using a Unity asset, ‘Terrain to Mesh’.
In this article, I won’t explain how to create a terrain with ‘Terrain’ so please refer to the following article if you want to learn how to use Terrain itself.
This time I begin with the state that the ground has been already created with Terrain.
Terrain To Mesh
Total file size: 20.2MB
Supported Unity Version: 5.6.4 or higher
Export Mesh and Texture
After importing the ‘Terrain To Mesh’ asset to Unity, select ‘Window > VacuumShaders > Terrain To Mesh’ in the menu bar.
Then, the following window will be displayed.
Set each parameter as shown above.
From the HIerarchy window, drag and drop the Terrain you use.
After the setting is finished, press “Generate’ to start exporting.
Integrate the exported files in Unity
Once the export is completed, a new folder ‘(Temporary)’ will be created in the Asset folder.
Open the ‘OBJ’ folder under the Temporary folder to find the exported mesh.
Add it to the Scene.
Next, there is a Material called ‘New Terrain_Material’, so apply it to the mesh in the Scene.
As the 3D models of trees are not exported, transfer the trees from the Terrain you first created in the Scene to the new Terrain you added to the Scene now.
In the Hierarchy window, the 3D models of trees are separated from the Terrain, so store them in the new Terrain.
Now, the terrain created with “Terrain’ has been converted into a 3D model with a reduced size, which can be resized and rotated after uploading to STYLY.
Upload to STYLY
Please refer to the article to learn how to upload a Terrain from Unity to STYLY.
Now, the Terrain has been uploaded to STYLY.