Last updated
Last updated
TTM offers rendering generated meshes by using 2 types of materials: SplatMap and Basemap. Each one has is pros and cons.
Splatmap material imitates Unity's built-in terrain shader and can render 16 layers (with their own Diffuse/Normal/Mask maps) using one shader pass and with textures in original resolution. However rendered textures count may be limited on WebGL and mobile devices.
Basemap material bakes all terrain layer textures into one texture file, works with any shader and supports all devices. However final texture resolution is limited to 8K and for large terrains requiring high detail rendering this material may not be suitable.
Note, TTM reads textures and material data from TerrainData object, not Terrain component and assumes that source terrain uses Unity's built-in terrain shader.
TTM cannot export textures and materials from custom terrain shaders.
Imitates Unity's built-in terrain shader and can blend maximum 16 layers using 4 control maps.
Layer settings are exactly the same as Unity's built-in terrain shader and produces the same terrain/mesh rendering result.
All 16 layers with their Diffuse/Bump/Mask textures are rendered in one shader pass and while it is much faster and optimized compared to the Unity's built-in terrain shader, rendering all 16 layers is not guaranteed on all devices.
After building a project, some devices may fail to fully render Splatmap shader if material uses more textures than their GPU supports, which varies from 6 to 8 textures for GLES2 mobile devices and up to 16 for GLES3. DirectX 11 however can render 128 textures.
If device can't render all textures used by the Splatmap material, then material behavior can be different depending on the device and its GPU:
Mesh may be rendered in ‘pink’ color. It means that device cannot compile shader at all.
GPU renders as many textures as it can and all left textures are rendered in black color.
Mesh may not be rendered at all.
(In the best case) Unity switches material to the Fallback shader and mesh will be rendered using Basemap Diffuse texture created by the TTM.
Always test Splatmap shader on the oldest device as possible and in the case of any problems mentioned above the only solution is to reduce used terrain textures count, one-by-one.
If device does not support rendering of the required amount of textures, TTM can bake them into Texture2DArray, in this case make sure the target device supports Texture2DArray and used Texture Formats using SystemInfo:
TTM bakes all terrain paint textures into one texture file and generates material using Unity's Standard or Lit shaders (based on the used render pipeline).
If Use Custom Shader is enabled, material will use any selected shader and baked Diffuse/Normal/Mask textures will be assigned to the properties whose names are defined in the Property fields:
Note, Property names not supported by the selected shader have yellow background and baked textures are not used by the generated material.
Note, some shaders may require enabling appropriate keywords inside material for the assigned texture to have an effect. For example, Standard material uses NormalMap texture only if it has _NORMALMAP keyword enabled, or _METALLICGLOSSMAP keyword for using Metallic texture.
TTM automatically enables those keywords. But if custom shader is used, then its keywords may be needed to be manually managed (by default through the material editor).