Export Basemap Occlusion Texture

Texture2D ExportBasemapOcclusionTexture(int resolution, bool enableHeightBasedBlend = false, float heightTransition = 0)

Bakes terrain layers Occlusion maps into one Basemap texture.

circle-info

Occlusion map is calculated from Mask map's green channel. If terrain layers don't use Mask maps, then Occlusion map also cannot be baked.

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 ExportBasemapOcclusionTexture method:

circle-info

Material's height based blend values can be read using Terrain.GetMaterialHeightBasedBlendValues method.


Splits terrain into 2D grid by splitCountHorizontal and splitCountVertical amount and for each chunk calculates BasemapOcclusion texture.

This method can be used in combination with multi-chunk mesh exporter, in this case index of a mesh in 2D grid array and Basemap texture's are the same.


Splits terrain into 2D grid by splitCountHorizontal and splitCountVertical amount and calculates BasemapOcclusion texture for chunk with index splitColumnIndex and splitRowIndex.

Last updated