Terrain To Mesh
  • Terrain To Mesh
  • Quick Start
  • Editor Window Settings
    • Mesh
    • Material
    • Objects
    • Save
  • Update Splatmap Shader
  • Run-time API
    • TerrainToMesh
      • ExportMesh
      • ExportTerrainLayers
      • ExportSplatmapMaterial
      • ExportSplatmapTextures
      • HasHoles
      • ExportHolesmapTexture
      • ExportBasemapDiffuseTexture
      • ExportBasemapNormalTexture
      • ExportBasemapMaskTexture
      • ExportBasemapOcclusionTexture
      • ExportGrassTextures
      • ExportGrassAtlasTexture
      • HasPrototypes
      • CountPrototypes
      • ExportPrototypes
    • TerrainToMeshUtilities
      • GenerateGrassMesh
      • GenerateEdgeFallTexture
      • ConvertMeshToOBJ
      • ConvertMeshToOBJAndSaveToFile
      • ConvertMeshToOBJAndAppendToFile
      • GetDefaultMaterial
      • GetDefaultShader
      • GetDefaultShaderProperty
      • SetupDefaultMaterial
      • SetupAlphaCutoutForDefaultMaterial
      • ConvertPrototypesToTreeGameObjects
      • ConvertPrototypesToGrassGameObjects
      • ConvertPrototypesToGrassMeshes
      • ConvertPrototypesToDetailMeshGameObjects
      • ConvertPrototypesToDetailMeshes
      • CalculateExportedMeshVertexCount
      • SetMeshPivotPoint
    • TerrainToMeshEdgeFall
    • TerrainToMeshPrototype
    • TerrainToMeshConversionDetails
  • Help & Contact
Powered by GitBook
On this page
  • Trees
  • Grass
  • Detail Meshes
PreviousMaterialNextSave

Last updated 2 months ago

TTM can export Trees, Grass and Detail Mashes from the Unity object.

Trees

Exported objects are original tree prefabs used by terrain, however prefabs do not have terrain tree rendering features like billboard or distance fading, unless those features are already implemented into the prefab.

Slope - If disabled, exported prefab's Up vector is oriented along world (0, 1, 0) direction. If enabled, then value of 1 rotates Up vector to be oriented along the terrain surface Normal.

Export Per Chunk - Option is available only when generating multi-chunk mesh and if it is enabled, exported tree prefabs are grouped under appropriate mesh chunk's parent gameObject.

Export % - Percent of exported trees.

Grass

Generates and exports grass using Quad meshes. Those meshes can be exported as a separate game objects or combined into one mesh file.

Exported mesh does not have terrain grass rendering features like billboard, distance fading, wind, etc.

For grass rendering can be used any shader.

Slope - If disabled, exported grass mesh's Up vector is oriented along world (0, 1, 0) direction. If enabled, then value of 1 rotates Up vector to be oriented along the terrain surface Normal.

Export Per Chunk - Option is available only when generating multi-chunk mesh and if it is enabled, exported grass meshes are grouped under appropriate mesh chunk's parent gameObject.

Export % - Percent of exported grass.

Sides - By default generated grass mesh uses Quad mesh with one side. This option allows using mesh with multiple sides:

Distortion - If using multi-sided grass mesh, instead of placing each quad inside symmetrical center, this setting adds a little offset to the their position:

Using multi-sided grass meshes with position distortion, can create effect of multiplying terrain grass objects up to 12 times. But each increased side count, increases generated grass mesh vertex count 4 times.

UV3 - Available only if combining grass meshes and offers saving each quad's Pivot Point's position or grass texture's UV inside generated mesh UV3 buffer. This data may be used in custom shaders, for example with Billboard shaders.

TTM asset package does not include any special grass shaders. Generated grass mesh is rendered using Unity built-in Mobile Diffuse shader.

In the case of using any custom grass shader, TTM grass Quad mesh vertex color's Alpha channel contains mesh’s Bottom & Top values - 0 and 1 accordingly.

In the case of combining meshes, vertex color's RGB channels contain Healthy & Dry color values.

Combine - Allows combining (merging) grass objects into one mesh:

  • None - Each grass is a separate game object.

  • By Texture - Grass meshes are combined based on the used grass texture. For each group is generated separate material based on the used grass texture.

  • By Texture With Atlas - Grass meshes are combined based on the used grass texture. Additionally grass textures are combined into one Atlas texture and one material is used for rendering all grass meshes.

  • Everything - Combines all grass meshes into one file, combines grass textures into one Atlas texture and one material is used for rendering all grass meshes.

∑ Vertices - Defines vertex count for combined meshes. Instead of combining grass meshes into one file, it is possible to split resultant mesh with required vertex count.

Use Custom Shader - Instead of using package included grass shader, allows selection custom one for grass rendering.

Cast Shadows - Specify if generated grass Mesh Renderer → Lighting → Cast Shadows option is enabled or no.

Detail Meshes

Exported objects are original detail mesh prefabs used by terrain, however prefabs do not have terrain rendering features like billboard or distance fading, unless those features are already implemented into the prefab.

Slope - If disabled, exported prefab's Up vector is oriented along world (0, 1, 0) direction. If enabled, then value of 1 rotates Up vector to be oriented along the terrain surface Normal.

Export Per Chunk - Option is available only when generating multi-chunk mesh and if it is enabled, exported tree prefabs are grouped under appropriate mesh chunk's parent gameObject.

Export % - Percent of exported details.

Combine - Allows combining (merging) detail objects into one mesh:

  • None - Each detail is a separate game object - original prefab.

Rotation - If disabled, prefab rotation is read from the source object. Otherwise custom rotation can be selected manually.

Rotation - If disabled, grass rotation is read from the source object. Otherwise custom rotation can be selected manually.

Rotation - If disabled, prefab rotation is read from the source object. Otherwise custom rotation can be selected manually.

By Prefab - Detail objects are combined into one mesh file based on the used prefab. For rendering is used only the first material from the prefab's top component. Also combined meshes have Healthy & Dry color baked inside vertex color.

TerrainData
TerrainData
TerrainData
MeshRenderer
TerrainData
Comparison of the slope values of 0 and 1
Grass mesh with 1, 2, and 3 sides. Max is 12 sides.
Grass mesh with 4 sides and distortion value of 0, 0.5 and 1