Export Splatmap Material

Material ExportSplatmapMaterial(bool hasHolesmap, bool enableHeightBasedBlend = false, float heightTransition = 0)

Generates TTM Splatmap material same as using the editor tool. 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.

circle-exclamation

By default TerrainDataarrow-up-right object doesn't use Height Based Blend feature. This is optional feature for the terrain material and if converted terrain uses it, it needs to be manually set inside ExportSplatmapMaterial method:

circle-info

Material's height based blend values can be read using TerrainToMeshUtilities.GetTerrainMaterialHeightBasedBlendSettings method.


Generates TTM Splatmap material same as using the editor tool but all textures need to be manually packed into Texture2DArrayarrow-up-right.

Last updated