Class TerrainDetailBake
A scene's terrain detail maps, baked by the cut (TerrainDetailBaker, client editor): per terrain, what the client's blade grass (GrassTerrain) and GPU detail scatter (DetailScatterTerrain) used to build from the terrain data on every Play — the summed, smoothed and packed density maps, the heights, the water line and holes, the surface layers, the work items' bounds — and the terrain's index map (TerrainDetailBake.IndexMap, what the array terrain draws in a player), plus the grass's colour copies of the terrain texture sets. The client takes a terrain from here in a frame instead of reading it back over ~1,400 frames, and falls back to building it whenever an entry does not match what it would build (Version, the prototypes and their prefabs, the resolutions, the scatter's density scale) or is marked Stale.
[PreferBinarySerialization]
public sealed class TerrainDetailBake : ScriptableObject
- Inheritance
-
ObjectScriptableObjectTerrainDetailBake
- Inherited Members
-
ScriptableObject.SetDirty()ScriptableObject.CreateInstance<T>()Object.GetEntityId()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Remarks
Client data. Only SceneTerrainBake references it, on a ClientOnlyObject, so server builds drop it. Binary: the maps are megabytes, which the project's text serialization would write as hex.
What is not baked. Anything the runtime decides: the grass and scatter types (their indices, the profile's tunings, the heights the grass cover is weighed by), which are resolved at load and checked against the prefabs recorded here.
Fields
Albedos
public List<TerrainDetailBake.Albedo> Albedos
Field Value
BakedVersion
The Version this was baked at.
public int BakedVersion
Field Value
Ground
The ground colour and normal maps under the scene's terrains (GroundColourMap), as the client builds them at Play.
public TerrainDetailBake.GroundColour Ground
Field Value
Tiles
public List<TerrainDetailBake.Tile> Tiles
Field Value
Version
The layout and the build's arithmetic: bumped whenever either builder changes what it computes, so every bake made before reads as unusable (the runtime builds those terrains as before) until the scene is cut or rebaked.
public const int Version = 3
Field Value
Remarks
2: tussock grass channels keep the biome's carpet coverage instead of each terrain's scaled to full. 3 (2026-10-27): the grass's and the scatter's hole masks keep their plants a margin clear of every hole's edge (TerrainHoleMask.KeepPlantsClear). NOT bumped for the GPU-only change (2026-10-27: only the prototypes painted on a terrain are read, the scatter takes every mesh kind the blades do not and keeps its density sparse, Entries): a grass or scatter entry baked before lists every prototype, so it no longer matches what play selects (Builder.SameLayout) and an old scatter entry has no sparse density (Builder.TakeBaked's checks), so both are rebuilt at play until the scene is rebaked; bumping would also have thrown away the still-valid index maps and ground colour map.
Methods
TileOf(TerrainData)
This bake's entry for a terrain's data, or null.
public TerrainDetailBake.Tile TileOf(TerrainData data)
Parameters
dataTerrainData