Mesh to Terrain

Documentation for Mesh To Terrain v2.5

Description

Tool for easily and quickly converting a 3D terrain model created in 3ds Max, Terragen or any other editor to Unity Terrains. Mesh to Terrain can convert textures to SplatPrototypes (Terrain Layers), generate terrain from several models and split the model into several terrains.

Using

Important: before starting, please make sure that your model has Index Format - 16 bits. Otherwise, when the mesh has more than 65k vertices, Physic.Raycast is unstable and may cause the editor to freeze at any time.

Add the 3D scene model that you want to convert into Terrain. The number of models is not limited, and they can have any nesting.

Important: You can use any model, but Unity Terrains can only be rectangular. Keep this in mind when converting non-rectangular models.

Select the menu item «Window / Infinity Code / Mesh to Terrain», to open the component. Specify the required settings, click «Start» and wait for the conversion. Depending on your computer performance, the number of pieces and settings it can take from a few seconds to several minutes.

Important: If the model has a collider, other than «Mesh Collider», it can be converted incorrectly. To solve the problem, remove the collider component from models.

Description of fields

MeshToTerrain

Mesh to Terrain window contains three sections:

Meshes

In «Mesh select type» section Meshes, select how you want to define a model for the transformation:

In «Direction», specify the direction of raytracing:

In «Y Range», select the desired range of heights:

Terrains

In «Type» section Terrains, select:

If «Type - New Terrains» is selected, then there are additional settings:

If you want to use smoothing, choose the «Use smoothing of height maps» and set the smoothing factor.

Field «Holes» determines the behavior of Mesh to Terrain for areas of models where the height is unknown (holes and the edge of the model, if the model is not rectangular):

Textures

Mesh to Terrain can optionally generate one texture for each Terrains.

Result Type:

Mesh to Terrain has two modes for generating textures:

Auto Setup Lighting - automatically setup lighting in the scene for Capture Mode - Camera, and after conversion restores its original state.

Manual Light Setup for Capture Mode - Camera

There are many ways to setup the lighting in a scene.

The simplest and best result:

  1. Disable all lights in the scene.
  2. Open Window / Rendering / Lighting / Environment.
  3. Environment Lighting / Source - Color, Ambient Color - White.

After conversion, you can enable the lights, and return Environment Lighting / Source - Skybox.

Convert from the context menu

In «Hierarchy» right-click on the GameObject, you want to convert into terrain. Opens «Mesh to Terrain» with the selected GameObject.

Integration with third party assets

Third party assets are not included in Mesh to Terrain and must be purchased separately.

Huge Texture

https://assetstore.unity.com/packages/tools/input-management/huge-texture-163576

Huge Texture allows you to generate textures larger than 8192x8192px. Integration with Huge Texture is automatically enabled when importing Huge Texture into a project.

Select «Mesh to Terrain / Textures / Result Type - Huge Texture», and specify the page size, number of columns and rows.

Huge Texture allows you to generate textures up to 2GB (0.715 gigapixels, 26624x26624px for square textures without transparency).

Huge Texture has several limitations:

  1. You cannot use Terrain Layers.
  2. You will be able to use only Texture / Capture Mode - Raycast (read more in the Description of fields / Textures section).
  3. Integration with Relief Terrain Pack will not work.

Relief Terrain Pack

https://assetstore.unity.com/packages/tools/terrain/relief-terrain-pack-v3-3-5664

Integration with Relief Terrain Pack is disabled by default. Import Relief Terrain Pack to your project. Open Mesh to Terrain. Select Third-party / Enable Relief Terrain Pack.

No settings Relief Terrain Pack is required. If you have any questions about Relief Terrain Pack, you can find answers in the documentation of Relief Terrain Pack.

Important: Relief Terrain Pack is not compatible with Huge Texture, and you won't see the benefits of Relief Terrain Pack when generating Huge Texture.

If you want to delete Relief Terrain Pack from the project, you should first disable it in Mesh to Terrain (Third-party / Disable Relief Terrain Pack).

If you forget to disable Relief Terrain Pack and removed it, then you will see errors in the console. To manually remove support of Relief Terrain Pack, open PlayerSettings (Edit / Project Settings / Player) and delete the corresponding entry from «Scripting Define Symbols».

Updating versions

In Unity Asset Store we ship only stable versions. Renewal period is several months.

Mesh to Terrain has a built-in update system, using which you can get early access to all versions and updates. Click «Window / Infinity Code / Mesh to Terrain / Check Updates», to open window checking for updates. Enter your Invoice Number, select a channel of updates and click «Check New Versions».

If updates are available, you can read the list of changes and download the update.

If you have any problems with installing the update, then:

  1. Open an empty scene.
  2. Delete the folder «Infinity Code / Mesh to Terrain».
  3. Import the new asset version in the project.

Troubleshooting

After starting you get the error border or nothing happens.

There are two reasons for this:

  1. The models in the scene have a size that is insufficient for correct operation of physics. You need to increase the model in 100 + times and start the component again The problem is that the default scaling factor of imported models «0.01».
  2. You choose the models are not in the scene. Add model in the scene and convert them.

Terrains not correspond to the models axis Y.

Scale up the model several times.

New terrains have a insufficient resolution / accuracy.

  1. Increase the Height Map Resolution.
  2. Increase the number of new terrains.

You cannot see the grass or trees.

  1. Zoom in to the place where you draw grass or trees.
  2. Increase the value of «Tree Distance» in Terrain settings.

You receive an error «Selected meshes not in the scene», and the model is in the scene.

Please make sure that you choose a model from the tab «Scene».

Conversion process freeze at some percentage

Please make sure your model has an Index Format of 16 bits. Otherwise, when the mesh has more than 65k vertices, Physic.Raycast is unstable and may cause the editor to freeze at any time.

Support

We provide support by email (support@infinity-code.com) in English and Russian languages, or using forum (https://forum.infinity-code.com) in English language. If you have something does not work, you find a bug, or you have a suggestion, please contact us. Please, specify your version of Unity, OS, and the current version of Mesh to Terrain. We strive to answer all emails in the customer support within 24 hours.

Other Infinity Code assets

Huge Texture

Huge Texture

https://assetstore.unity.com/packages/tools/input-management/huge-texture-163576

Huge Texture allows you to import and use textures larger than 8192x8192px.

How it works: When importing a texture, Huge Texture splits the texture into pages and saves it as a Texture Array. Texture Array is combined on the shader side, which does not create extra draw calls and has almost no effect on performance.

Features:

Requirements:

Online Maps

Online Maps

https://assetstore.unity.com/packages/tools/integration/online-maps-v3-138509

Online Maps is a universal multi-platform mapping solution for your 2D, 3D, AR / VR and mobile applications and games. Fully customizable, incredibly easy to learn and use, and at the same time is one of the most powerful and flexible solutions in the industry. Supports a huge number of services for any mapping needs, and has integration with the best Asset Store assets. The package contains the complete source code without dependencies, and if you want to add or change some feature, you can easily do it. Don't have programming experience or don't know C# - Online Maps supports visual scripting using Bolt and Playmaker. All the features to create any map in Unity in one asset.

Features:

Project Context Actions

Project Context Actions

https://assetstore.unity.com/packages/tools/utilities/project-context-actions-267429

Project Context Actions is a standalone free toolkit from Ultimate Editor Enhancer asset that speeds up work with the Project window by adding contextual actions based on item type.

Supports one-column and two-column layouts.

Context actions are displayed when you hover over a row or cell in the project that matches certain criteria.

List of actions:

Real World Terrain

Real World Terrain

https://assetstore.unity.com/packages/tools/terrain/real-world-terrain-8752

Real World Terrain is a tool for automatically creating high-quality terrains, meshes, Gaia stamps and RAW files based on real-world data with global coverage. Incredibly fast and easy to use, and allows you to create high-quality terrains in a couple of clicks. In addition, Real World Terrain can create buildings, roads, trees, grass, and rivers based on Open Street Map data. Real World Terrain is incredibly powerful and flexible. It has a powerful Editor API to automate the generation of terrains, and Runtime API positioning objects by coordinates, etc. Real World Terrain has integration with the best assets of the Asset Store, which gives almost unlimited possibilities in the generation of terrains.

Features:

Run Desired Scene

Run Desired Scene

https://assetstore.unity.com/packages/tools/utilities/run-desired-scene-262762

Run Desired Scene is a very powerful and easy to use tool that allows you to start playing from any scene without opening it. After exiting play mode, you will return to the scenes open for editing.

Features:

Smart Gallery

Smart Gallery is an elegant, flexible and efficient solution for displaying image, video and audio galleries for your project.

Key features:

Render Pipelines: Built-in RP, URP, HDRP, Custom RP. Input Systems: Old, New, Both. Platforms: PC, Mac, iOS, Android, UWP, WebGL. Other platforms have not been tested, but most likely Smart Gallery will work well.

Terrain Quality Manager

Terrain Quality Manager

https://assetstore.unity.com/packages/tools/terrain/terrain-quality-manager-28949

Terrain Quality Manager allows you to change the resolution of Heightmap, Detailmap, Alphamap and Basemap, without losing data. If you need to increase the quality of terrain, or optimize terrain for better performance, with this tool you can do it.

Features:

Tiny Terrain

Tiny Terrain

https://assetstore.unity.com/packages/tools/terrain/tiny-terrain-236464

Tiny Terrain is a lossy Terrain Data compression technology for Unity Terrain Engine, which allows you to reduce the size of the data that Terrain takes in the project many times and significantly reduce the size of your application. You pay a little CPU time and additional memory usage, but save tens and hundreds of megabytes for each Terrain in the project. Even though the compression is lossy, in most cases you won't see any visual difference at all. A very high compression ratio is achieved due to the author's data preparation algorithms and then compression using Brotli. Even if your build or AssetBundle is already compressed using LZ4, LZ4HC or LZMA, Tiny Terrain will be able to reduce its size. Of course the difference in size won't be as huge as with the uncompressed data, but it's still pretty big.

The asset has highly optimized code using direct memory access, which allows for fast compression and decompression, and minimizes additional memory usage. On average, one Terrain is loaded in about 1 second. Tiny Terrain is not a 3rd party Terrain Engine, and you can use Unity Terrain API and any terrain tools you like, such as Real World Terrain, Gaia, Vegetation Studio, etc.

Using Tiny Terrain is very easy, and anyone can do it, even if it is their first day using Unity. Just add Tiny Terrain Loader component to Terrain and click Compress. If you are an advanced user or programmer, Tiny Terrain has events and API that will help you take full control of the loading process.

Features:

Platforms: The asset was tested on PC, Mac, Android, iOS, WebGL. The rest of the platforms have not been tested, but the asset should also work well on them.

Tree Tool

Tree Tool

https://assetstore.unity.com/packages/tools/terrain/tree-tool-288229

Tree Tool gives you full control over every tree on your terrains. You can move, scale, rotate, change color and prefab, extract and inject, duplicate and remove trees in just seconds. You can interact with each tree individually or with multiple trees at the same time.

The tool is very easy to use and you will be able to use it even if today is your first day of using Unity. It is perfectly optimized and will not slow down the scene even if you have more than 100k trees on terrain. Tree Tool is also fully compatible with trees created by Unity Terrain Editor or third party assets.

If you want to achieve perfect trees in your project, Tree Tool will be your best and indispensable friend.

Ultimate Editor Enhancer

Ultimate Editor Enhancer

https://assetstore.unity.com/packages/tools/utilities/ultimate-editor-enhancer-288737

Ultimate Editor Enhancer (ex uContext Pro) is productivity PowerPack that take your workflow in Unity Editor to a next level, simplifies working with content, adds new features to the editor, corrects and improves the editor’s built-in behaviors.

Dramatically improves Hierarchy, Inspector, Scene View and the editor itself.

Adds tools for quick navigation, creation and manipulation of objects.

 

Key Features:

List of tools:

 

uPano

uPano

https://assetstore.unity.com/packages/tools/integration/upano-126396

uPano (Unity Panoramic Framework) is a universal solution for displaying dynamic and static panoramas, and creating virtual tours. uPano is very easy to learn and use, and is great for people who do not have programming experience. Visual Tour Maker lets you create virtual tours in minutes. In most usage scenarios, you can make interactive panoramas without creating your own scripts. If you have some very specific purpose, uPano has a powerful and easy-to-use API that will allow you to implement any behavior. Most of the existing types of panoramas are supported: spherical, cylindrical, cubic panoramas on single or six images, cubemap.

Supported platforms: Standalone, iOS, Android (including Google VR), Universal Windows Platform, WebGL. Other platforms have not been tested, but most likely uPano will work well.

Additional features:

Value Observer

Value Observer

https://assetstore.unity.com/packages/tools/utilities/value-observer-266922

Value Observer is an editor-friendly implementation of the Observer pattern.

Contains: ValueObserver<T> - observes the value change and notifies listeners. Allows to validate the value change. LinkedObserver<T> - connects observer located in another component and allows to use it as a field of this class. LinkedValue<T> - connects any Serialized Property of any other component or Scriptable Object and allows it to be used as a field of this class. LinkedMethod<TResult> - connects any method that returns a value. Editor-friendly equivalent of Func. Supports up to 10 parameters.

Advantages:

Final words

We sincerely hope that you will enjoy using Mesh to Terrain. If you have any questions or problems, please contact us. We will try to help you as quickly as possible.

Please do not forget to leave your review in Unity Asset Store. It is very important for us to have feedback from users to make our assets better. For other users, it is also very important to make a right understanding of this asset.

Links

Product page: https://infinity-code.com/assets/mesh-to-terrain Forum: https://forum.infinity-code.com Support: support@infinity-code.com Videos: https://vimeo.com/channels/490422