Export Basemap Normal Texture

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

Bakes terrain's all painted layers Normal maps into one Basemap texture.

packNormals - If exported texture is meant to be used in run-time, then this value needs to be false. If after exporting texture will be saved on the hard drive and used inside editor, then this property needs to be true.

By default TerrainData object doesn't use Height Based Blend feature. This is optional feature for the terrain material and if exported texture needs to use it, then those values needs to be provided manually:

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


Texture2D[] ExportBasemapNormalTexture(int resolution, bool packNormals, int splitCountHorizontal, int splitCountVertical, bool enableHeightBasedBlend = false, float heightTransition = 0)

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


Texture2D ExportBasemapNormalTexture(int resolution, bool packNormals, int splitCountHorizontal, int splitCountVertical, int splitColumnIndex, int splitRowIndex, bool enableHeightBasedBlend = false, float heightTransition = 0)

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

Last updated