Jump to content
  • Sign Up

    Welcome to CANOPY.

    Browse the Forums, read articles in the Library, share your work in the Gallery, get the latest in Downloads

    Want more? Subscribe and get all our assets for a fraction of their asset store purchase price!

  • How to convert your Unity Terrains to (Low Poly) meshes or create Impostor Terrains with the Terrain Converter tool


    Peter

    Gaia contains a built-in tool for converting your unity terrain to meshes. With this tool, you can do the following:
     

    • Convert your native terrain object into a "pure" mesh object that only uses a mesh renderer. Meshes render a bit faster, but on the downside you might need additional tools for texturing / shading and vegetation rendering to get the same output as you would with the unity terrain object. Converting to a mesh can also be interesting if you process the terrain further within your project.
    • Convert your terrain to an .obj file - this file can be read by external modeling applications, which e.g. allows you to use your terrain in blender and process it there.
    • Output partial terrain meshes as .obj - By adding a mask to the .obj conversion, you can only export a part of the terrain as a mesh. This can be helpful if you want to hand-model overhangs and caves in an external application. By exporting a part of the terrain as a base for your model, you can make sure the object aligns well with the source terrain once you import it back into unity.
    • Collect Collision Information - The tool can collect all colliders from the terrains in the scene, the trees and the objects on it. This collected information can then e.g. be used to create a server side build, where no terrain is being rendered but collision still needs to be evaluated for the gameplay. It is even possible to collect all colliders from the individual terrains in terrain loading, or run terrain loading with the colliders only.
    • Convert terrains into low-poly style (Gaia Pro Only) - You can convert your terrain into a mesh that is rendered with a flat shaded vertex color shader - this goes well together with low poly art styles. A sample picture explains it best:

      image.png
       
    • Create Impostor Terrains for Terrain Loading (Gaia Pro Only) - When you are using Terrain Loading, the tool can create cheaper terrain meshes with little details for you. Those can be used as stand-ins for distant terrains. Up close Gaia will load the "full" unity terrains, in the distance it can display the cheaper Impostor mesh terrains.

    Please make sure to back up your project before using the Terrain Converter. Depending on the chosen settings you can permanently and irreversibly alter your terrains!

    The Terrain Converter can be found in the Advanced Tab of the Gaia Manager and opens as a separate Window:

    image.png

    image.png

    The Terrain Converter Tool is split up in 3 main panels:

    • Source - Which terrains you want to convert
    • Conversion Settings - What settings / conversion action to use for the conversion 
    • Visibility - Controls the visibility of the source terrains vs. the conversion result

    The general workflow is to select the source terrains you want to convert, choose the conversion settings which defines what is being done in the conversion itself, and then click the "Start Conversion" button. The Conversion Settings panel has a presets dropdown which allows you to use predefined settings for quick results - if you want to try the Converter out, these settings are a good starting point. You can pick one operation you want, and click the "Start Conversion" button.

    image.png

    The following sections give more information about the single panels.

    Source Panel

    image.png

    This panel allows you to select which terrains you want to convert. You can switch between "Scene" terrains (all terrains from the current scene) or "Terrain Loading" as Source Type. The latter allows you to select all terrains available for terrain loading, which allows you to select terrains that are currently not loaded in the scene yet.

    Note that the small checkbox on top of all checkboxes allows you to select / deselect all terrains at once.

    image.png
     

    Conversion Settings Panel

    image.png

    The Conversion Settings Panel contains the settings for the actual operation that is to be performed for the conversion. If you are not familiar with the settings yet, it is recommended to select one of the presets first.
    You can save and load your own preset settings with the respective buttons. Your own settings will start to appear in the preset dropdown after re-opening the Terrain Converter Window. You can control which presets should appear in this dropdown by editing the file
    Assets\Gaia User Data\Settings\UserFiles.asset

    The first actual setting itself is the "Conversion Action" which is the most important setting as this decides what is done with the source terrains:

    image.png

    • Mesh Terrain - converts the terrain into an unity mesh object
    • Collider Only - collects collider information
    • OBJ File Export - exports the terrain as .obj file into a folder in your project hierarchy

    Changing the conversion action will change all subsequent settings in the Conversion Settings panel. Depending on the settings you choose you can achieve the different use cases mentioned at the beginning of the article. 

    For example if you select the conversion action to be "Mesh Terrain" and you later on decide to reduce the mesh quality and apply a vertex color shader, you will effectively convert the terrain into a low-poly style. 

    To get more information about the individual settings, you can press the question mark button in the UI. This will display an explanation for each setting:

    image.png


    The "Mesh Terrain" conversion action is special in so far as that it offers the possibility to create multiple LOD levels: 

    image.png

    This will create a LOD group component on the converted mesh object. The different LOD levels will be built according to your LOD level settings. This e.g. allows you to create a mesh that will be rendered with a reduced amount of polygons the further away it is from the camera.

    image.png

    Visibility Panel

    image.png

    The visibility panel allows you to activate the original source terrains and / or the conversion result in the scene view. This can be helpful when comparing the original source vs. the conversion result.
    Note that this of course only applies to the mesh terrain conversions - the .obj files are not visible in the scene view, and the collider collections cannot be "seen" either (expect with the gizmos when the collider object is being selected in the inspector)


    A word on restoring your old terrains and running multiple conversions on the same terrains

    It is possible to a certain degree to run the conversions again and again from the same source terrains. For example it is possible to create impostor terrains again after a while if you made edits to your original source terrains. This requires however that you kept the source terrain in one way or another with the "Source Terrain Treatment" setting:

    image.png
     
    If the source terrains are still present after a previous conversion because they were just kept as they were ("Nothing") are still sitting in the scene as deactivated objects ("Deactivated") or are stored in separate backup scenes ("Store in Backup Scenes", only valid for Terrain Loading Setups), then these terrains can be restored for a subsequent conversion. If you decided to delete the terrains on conversion ("Delete") then the source terrain to perform the conversion does not exist anymore.
    Restoring the terrains from a backup or deactivation has its limits as well - Try to leave those terrains as they are after the conversion, if you start to re-parent, re-name, delete those objects it might also happen that they cannot be restored anymore for a second conversion as well.

    In any case it is wise to have a backup of your source terrains and / or work with source control so you can restore your original terrains yourself if need be.

     

    • Haha 1

    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...