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.

By default TerrainData 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:

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


Material ExportSplatmapMaterial(Texture2DArray splatmaps, Texture2DArray diffusemaps, Texture2DArray normalmaps, Texture2DArray maskmaps, bool hasHolesmap, bool enableHeightBasedBlend = false, float heightTransition = 0)

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

Last updated