> For the complete documentation index, see [llms.txt](https://amazing-assets.gitbook.io/terrain-to-mesh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://amazing-assets.gitbook.io/terrain-to-mesh/readme.md).

# Terrain To Mesh

[**Terrain To Mesh**](https://assetstore.unity.com/packages/tools/terrain/terrain-to-mesh-195349?aid=1011lvgVb) is a powerful Unity editor tool that converts built-in terrains into optimized mesh assets while preserving visual quality. It offers full control over vertex density, texture baking, and material generation, allowing you to fine-tune performance for mobile, VR, or large-scale projects.

Alongside its editor tools, **Terrain To Mesh** also provides a complete runtime API with identical functionality, enabling dynamic terrain-to-mesh conversions during gameplay or procedural scene generation.

#### Key features:

* **Ultra-fast conversion** — Instantly transform terrains into optimized meshes.
* **Full vertex control** — Precisely adjust mesh resolution for any performance target.
* **Built-in decimation & LOD support** — Generate LOD Groups and reduce poly counts effortlessly.
* **Mesh split system** — Seamlessly handle large terrains by splitting them into manageable mesh chunks.
* **Splatmap material rendering** — Render converted meshes using a splatmap-based material that accurately imitates Unity’s built-in terrain shader, supporting up to **16 texture layers** rendering in one pass.
* **Basemap textures baker** — Bake terrain layers into one texture, ready-to-use with any materials.
* **Trees, grass & details exporter** — Export all vegetation elements from terrains.
* **OBJ & FBX exporters** — Export generated meshes for external editing or other engines.
* **Runtime API included** — Perform the same conversions dynamically during gameplay.

{% hint style="warning" %}
⚠️Note:

* Converted meshes cannot fully replace Unity’s built-in terrain system. Meshes will not provide the same rendering quality, flexibility, or feature set as the native terrain engine.
* **Terrain To Mesh** works only with Unity [TerrainData](https://docs.unity3d.com/ScriptReference/TerrainData.html) object (not [Terrain](https://docs.unity3d.com/ScriptReference/Terrain.html)) and exports mesh, textures and materials only from it. Custom terrain shaders and tree/grass placement assets may not be fully supported.
* While Unity terrain supports unlimited layers, the **Terrain To Mesh**'s splatmap-based shader is limited to **16 layers**. Actual usable textures may vary depending on the target device’s capabilities. Some mobile or VR devices may not support rendering all 16 layers with multiple textures per layer.
* Holes in the generated mesh are not cut, instead they are rendered using **Alpha Cutout** shader.
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://amazing-assets.gitbook.io/terrain-to-mesh/readme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
