UnityEngine.TerrainModule Detail prototype used by the Terrain GameObject. Bend factor of the detailPrototype. Color when the DetailPrototypes are "dry". Color when the DetailPrototypes are "healthy". Maximum height of the grass billboards (if render mode is GrassBillboard). Maximum width of the grass billboards (if render mode is GrassBillboard). Minimum height of the grass billboards (if render mode is GrassBillboard). Minimum width of the grass billboards (if render mode is GrassBillboard). How spread out is the noise for the DetailPrototype. GameObject used by the DetailPrototype. Texture used by the DetailPrototype. Render mode for the DetailPrototype. Render mode for detail prototypes. The detail prototype will use the grass shader. The detail prototype will be rendered as billboards that are always facing the camera. Will show the prototype using diffuse shading. Represents a linear 2D transformation between brush UV space and a target XY space (typically this is a Terrain-local object space.) (Read Only) Brush UV origin, in XY space. (Read Only) Brush U vector, in XY space. (Read Only) Brush V vector, in XY space. (Read Only) Target XY origin, in Brush UV space. (Read Only) Target X vector, in Brush UV space. (Read Only) Target Y vector, in Brush UV space. Creates a BrushTransform. Origin of the brush, in target XY space. Brush U vector, in target XY space. Brush V vector, in target XY space. Applies the transform to convert a Brush UV coordinate to the target XY space. Brush UV coordinate to transform. Target XY coordinate. Creates an axis-aligned BrushTransform from a rectangle. Brush rectangle, in target XY coordinates. BrushTransform describing the brush. Get the axis-aligned bounding rectangle of the brush, in target XY space. Bounding rectangle in target XY space. Applies the transform to convert a target XY coordinate to Brush UV space. Point in target XY space. Point transformed to Brush UV space. The context for a paint operation that may span multiple connected Terrains. (Read Only) RenderTexture that an edit operation writes to modify the data. (Read Only) The value of RenderTexture.active at the time CreateRenderTargets is called. (Read Only) The Terrain used to build the PaintContext. (Read Only) The pixel rectangle that this PaintContext represents. (Read Only) The size of a PaintContext pixel in terrain units (as defined by originTerrain.) (Read Only) Render target that stores the original data from the Terrains. (Read Only) The height of the target terrain texture. This is the resolution for a single Terrain. (Read Only) The width of the target terrain texture. This is the resolution for a single Terrain. (Read Only) The number of Terrains in this PaintContext. Flushes the delayed actions created by PaintContext heightmap and alphamap modifications. Releases the allocated resources of this PaintContext. When true, indicates that this function restores RenderTexture.active Constructs a PaintContext that you can use to edit a texture on a Terrain, in the region defined by boundsInTerrainSpace and extraBorderPixels. Terrain that defines terrain space for this PaintContext. Terrain space bounds to edit in the target terrain texture. Width of the target terrain texture (per Terrain). Height of the target terrain texture (per Terrain). Number of extra border pixels required. Creates the sourceRenderTexture and destinationRenderTexture. Render Texture format. Creates a new PaintContext, to edit a target texture on a Terrain, in a region defined by pixelRect. Terrain that defines terrain space for this PaintContext. Pixel rectangle to edit in the target terrain texture. Width of the target terrain texture (per Terrain). Height of the target terrain texture (per Terrain). Gathers the alphamap information into sourceRenderTexture. TerrainLayer used for painting. Set to true to specify that the inputLayer is added to the terrain if it does not already exist. Set to false to specify that terrain layers are not added to the terrain. Gathers the heightmap information into sourceRenderTexture. Gathers the normal information into sourceRenderTexture. Retrieves the clipped pixel rectangle for a Terrain, relative to the PaintContext render textures. Index of the Terrain. Returns the clipped pixel rectangle. Retrieves the clipped pixel rectangle for a Terrain. Index of the Terrain. Returns the clipped pixel rectangle. Retrieves a Terrain from the PaintContext. Index of the terrain. Returns the Terrain object. Applies an edited alphamap PaintContext by copying modifications back to the source Terrains. Unique name used for the undo stack. Applies an edited heightmap PaintContext by copying modifications back to the source Terrains. Unique name used for the undo stack. A set of utility functions for custom terrain paint tools. Helper function to set up a PaintContext for modifying the heightmap of one or more Terrain tiles. Reference Terrain tile. Defines terrain space and heightmap resolution. The region in terrain space to edit. Number of extra border pixels required. PaintContext containing the combined heightmap data for the specified region. Helper function to set up a PaintContext for modifying the heightmap of one or more Terrain tiles. Reference Terrain tile. Defines terrain space and heightmap resolution. The region in terrain space to edit. Number of extra border pixels required. PaintContext containing the combined heightmap data for the specified region. Helper function to set up a PaintContext for modifying the alphamap of one or more Terrain tiles. Reference Terrain tile. Defines terrain space and alphamap resolution. Selects the alphamap to paint. The region in terrain space to edit. Number of extra border pixels required. PaintContext containing the combined alphamap data for the specified region. Helper function to set up a PaintContext for modifying the alphamap of one or more Terrain tiles. Reference Terrain tile. Defines terrain space and alphamap resolution. Selects the alphamap to paint. The region in terrain space to edit. Number of extra border pixels required. PaintContext containing the combined alphamap data for the specified region. Builds a Scale & Offset transform to convert between one PaintContext's UV space and another PaintContext's UV space. Source PaintContext. Destination PaintContext. ScaleOffset transform. Enumeration of the render passes in the built-in paint material. Built-in render pass for painting the splatmap texture. Built-in render pass for raising and lowering terrain height. Built-in render pass for setting terrain height. Built-in render pass for smoothing the terrain height. Built-in render pass for stamping heights on the terrain. Creates a BrushTransform from the input parameters. Reference terrain, defines terrain UV and object space. Center point of the brush, in terrain UV space (0-1 across the terrain tile). Size of the brush, in terrain space. Brush rotation in degrees (clockwise). Transform from terrain space to Brush UVs. Helper function to set up a PaintContext that collects mesh normal data from one or more Terrain tiles. Reference Terrain tile. Defines terrain space and heightmap resolution. The region in terrain space from which to collect normals. Number of extra border pixels required. PaintContext containing the combined normalmap data for the specified region. Helper function to set up a PaintContext that collects mesh normal data from one or more Terrain tiles. Reference Terrain tile. Defines terrain space and heightmap resolution. The region in terrain space from which to collect normals. Number of extra border pixels required. PaintContext containing the combined normalmap data for the specified region. Helper function for completing a heightmap modification. The heightmap paint context to complete. Unique name used for the undo stack. Helper function for completing a texture alphamap modification. The texture paint context to complete. Unique name used for the undo stack. Finds the index of a TerrainLayer in a Terrain tile. Terrain tile. Terrain layer to search for. Returns the index of the terrain layer if it exists or -1 if it doesn't exist. Returns the default material for blitting operations. Built in "Hidden/BlitCopy" material. Returns the built-in in paint material used by the built-in tools. Built-in terrain paint material. Returns the default copy terrain layer material. Built in "HiddenTerrainTerrainLayerUtils" material. Returns the alphamap texture at mapIndex. Terrain tile. Index to retrieve. Alphamap texture at mapIndex. Releases the allocated resources of the specified PaintContext. The PaintContext containing the resources to release. Sets up all of the material properties used by functions in TerrainTool.cginc. PaintContext describing the area we are editing, and the terrain space. BrushTransform from terrain space to Brush UVs. Material to populate with transform properties. Provides a set of utility functions that are used by the terrain tools. Automatically connects neighboring terrains. Type for mapping Terrain.groupingID coordinates to TerrainMap. Type for mapping 2D (X,Y) coordinates to a Terrain object. Indicates the error status of the TerrainMap. Mapping from TileCoord to Terrain. Creates a TerrainMap. Defines the grid origin and size, as well as group id if no filter is specified. Origin of the grid. Size of the grid. Typically takes the terrain size.x and size.z. Filter to be applied when populating the map. See Also: TerrainFilter. If null, the filter will fall back to matching terrains in the same group as the origin. Validate the terrain map. Default is true. The resulting terrain map. Can return null when no terrains pass the filter. Creates a TerrainMap. Defines the grid origin and size, as well as group id if no filter is specified. Origin of the grid. Size of the grid. Typically takes the terrain size.x and size.z. Filter to be applied when populating the map. See Also: TerrainFilter. If null, the filter will fall back to matching terrains in the same group as the origin. Validate the terrain map. Default is true. The resulting terrain map. Can return null when no terrains pass the filter. Retrieves the Terrain object corresponding to the tile coordinates (tileX,tileZ). Tile X coordinate. Tile Z coordinate. Returns a valid Terrain object if successful, null otherwise. Structure containing minimum and maximum terrain patch height values. Maximum height of a terrain patch. Minimum height of a terrain patch. A Splat prototype is just a texture that is used by the TerrainData. The metallic value of the splat layer. Normal map of the splat applied to the Terrain. The smoothness value of the splat layer when the main texture has no alpha channel. Texture of the splat applied to the Terrain. Offset of the tile texture of the SplatPrototype. Size of the tile used in the texture of the SplatPrototype. The Terrain component renders the terrain. The active terrain. This is a convenience function to get to the main terrain in the Scene. The active terrains in the Scene. Specifies if the terrain tile will be automatically connected to adjacent tiles. Heightmap patches beyond basemap distance will use a precomputed low res basemap. Terrain bottom neighbor. Should terrain cast shadows?. Collect detail patches from memory. Density of detail objects. Detail objects will be displayed up to this distance. Specify if terrain heightmap should be drawn. Set to true to enable the terrain instance renderer. The default value is false. Specify if terrain trees and details should be drawn. Controls what part of the terrain should be rendered. Whether some per-camera rendering resources for the terrain should be freed after not being used for some frames. Grouping ID for auto connect. Lets you essentially lower the heightmap resolution used for rendering. An approximation of how many pixels the terrain will pop in the worst case when switching lod. RenderTextureFormat of the terrain heightmap. Texture format of the terrain heightmap. Terrain left neighbor. The shininess value of the terrain. The specular color of the terrain. The index of the baked lightmap applied to this terrain. The UV scale & offset used for a baked lightmap. The custom material used to render the terrain. The type of the material used to render the terrain. Could be one of the built-in types or custom. See Terrain.MaterialType. Returns the normal map texture computed from sampling the heightmap. It is only used when terrain is rendered using instancing. Set the terrain bounding box scale. Allows you to specify how Unity chooses the for tree instances. The index of the realtime lightmap applied to this terrain. The UV scale & offset used for a realtime lightmap. How reflection probes are used for terrain. See Rendering.ReflectionProbeUsage. Terrain right neighbor. The Terrain Data that stores heightmaps, terrain textures, detail meshes and trees. Terrain top neighbor. Distance from the camera where trees will be rendered as billboards only. Total distance delta that trees will use to transition from billboard orientation to mesh orientation. The maximum distance at which trees are rendered. The multiplier to the current LOD bias used for rendering LOD trees (i.e. SpeedTree trees). Maximum number of trees rendered at full LOD. Adds a tree instance to the terrain. Update the terrain's LOD and vegetation information after making changes with TerrainData.SetHeightsDelayLOD. Creates a Terrain including collider from TerrainData. Flushes any change done in the terrain so it takes effect. Fills the list with reflection probes whose AABB intersects with terrain's AABB. Their weights are also provided. Weight shows how much influence the probe has on the terrain, and is used when the blending between multiple reflection probes occurs. [in / out] A list to hold the returned reflection probes and their weights. See ReflectionProbeBlendInfo. Get the position of the terrain. Get the previously set splat material properties by copying to the dest MaterialPropertyBlock object. The type of the material used to render a terrain object. Could be one of the built-in types or custom. A built-in material that uses the legacy Lambert (diffuse) lighting model and has optional normal map support. A built-in material that uses the legacy BlinnPhong (specular) lighting model and has optional normal map support. A built-in material that uses the standard physically-based lighting model. Inputs supported: smoothness, metallic / specular, normal. Use a custom material given by Terrain.materialTemplate. Samples the height at the given position defined in world space, relative to the terrain space. Marks the current connectivity status as invalid. Lets you setup the connection between neighboring Terrains. Set the additional material properties when rendering the terrain heightmap using the splat material. Indicate the types of changes to the terrain in OnTerrainChanged callback. Indicates a change to the heightmap data without computing LOD. Indicates that a change was made to the terrain that was so significant that the internal rendering data need to be flushed and recreated. Indicates a change to the heightmap data. Indicates a change to the detail data. Indicates a change to the tree data. Indicates that the TerrainData object is about to be destroyed. The TerrainData class stores heightmaps, detail mesh positions, tree instances, and terrain texture alpha maps. Height of the alpha map. Number of alpha map layers. Resolution of the alpha map. Returns the number of alphamap textures. Alpha map textures used by the Terrain. Used by Terrain Inspector for undo. Width of the alpha map. Resolution of the base map used for rendering far patches on the terrain. The local bounding box of the TerrainData object. Detail height of the TerrainData. The number of patches along a terrain tile edge. This is squared to make a grid of patches. Contains the detail texture/meshes that the terrain has. Detail Resolution of the TerrainData. Detail Resolution of each patch. A larger value will decrease the number of batches used by detail objects. Detail width of the TerrainData. Height of the terrain in samples (Read Only). Resolution of the heightmap. The size of each heightmap sample. Returns the heightmap texture. Width of the terrain in samples (Read Only). The total size in world units of the terrain. Splat texture used by the terrain. Retrieves the terrain layers used by the current terrain. The thickness of the terrain used for collision detection. Returns the number of tree instances. Contains the current trees placed in the terrain. The list of tree prototypes this are the ones available in the inspector. Amount of waving grass in the terrain. Speed of the waving grass. Strength of the waving grass in the terrain. Color of the waving grass that the terrain has. Returns the alpha map at a position x, y given a width and height. The x offset to read from. The y offset to read from. The width of the alpha map area to read. The height of the alpha map area to read. A 3D array of floats, where the 3rd dimension represents the mixing weight of each splatmap at each x,y coordinate. Returns the alphamap texture at the specified index. Index of the alphamap. Alphamap texture at the specified index. Returns a 2D array of the detail object density in the specific location. Gets the height at a certain point x,y. Get an array of heightmap samples. First x index of heightmap samples to retrieve. First y index of heightmap samples to retrieve. Number of samples to retrieve along the heightmap's x axis. Number of samples to retrieve along the heightmap's y axis. Gets an interpolated height at a point x,y. Get an interpolated normal at a given location. Returns an array of tesselation maximum height error values per renderable terrain patch. The returned array can be modified and passed to OverrideMaximumHeightError. Float array of maximum height error values. Returns an array of min max height values for all the renderable patches in a terrain. The returned array can be modified and then passed to OverrideMinMaxPatchHeights. Minimum and maximum height values for each patch. Gets the gradient of the terrain at point (x,y). Returns an array of all supported detail layer indices in the area. Get the tree instance at the specified index. It is used as a faster version of treeInstances[index] as this function doesn't create the entire tree instances array. The index of the tree instance. Override the maximum tessellation height error with user provided values. Note that the overriden values get reset when the terrain resolution is changed and stays unchanged when the terrain heightmap is painted or changed via script. Provided maximum height error values. Override the minimum and maximum patch heights for every renderable terrain patch. Note that the overriden values get reset when the terrain resolution is changed and stays unchanged when the terrain heightmap is painted or changed via script. Array of minimum and maximum terrain patch height values. Reloads all the values of the available prototypes (ie, detail mesh assets) in the TerrainData Object. Assign all splat values in the given map area. Marks the terrain data as dirty to trigger an update of the terrain basemap texture. Sets the detail layer density map. Set the resolution of the detail map. Specifies the number of pixels in the detail resolution map. A larger detailResolution, leads to more accurate detail object painting. Specifies the size in pixels of each individually rendered detail patch. A larger number reduces draw calls, but might increase triangle count since detail patches are culled on a per batch basis. A recommended value is 16. If you use a very large detail object distance and your grass is very sparse, it makes sense to increase the value. Set an array of heightmap samples. First x index of heightmap samples to set. First y index of heightmap samples to set. Array of heightmap samples to set (values range from 0 to 1, array indexed as [y,x]). Set an array of heightmap samples. First x index of heightmap samples to set. First y index of heightmap samples to set. Array of heightmap samples to set (values range from 0 to 1, array indexed as [y,x]). Set the tree instance with new parameters at the specified index. However, TreeInstance.prototypeIndex and TreeInstance.position can not be changed otherwise an ArgumentException will be thrown. The index of the tree instance. The new TreeInstance value. Triggers an update to integrate modifications done to the heightmap outside of unity. Start X position of the dirty heightmap region. Start Y position of the dirty heightmap region. Width of the the dirty heightmap region. Width of the the dirty heightmap region. Extension methods to the Terrain class, used only for the UpdateGIMaterials method used by the Global Illumination System. Schedules an update of the albedo and emissive Textures of a system that contains the Terrain. Schedules an update of the albedo and emissive Textures of a system that contains the Terrain. Description of a terrain layer. A Vector4 value specifying the maximum RGBA value that the diffuse texture maps to when the value of the channel is 1. A Vector4 value specifying the minimum RGBA value that the diffuse texture maps to when the value of the channel is 0. The diffuse texture used by the terrain layer. A Vector4 value specifying the maximum RGBA value that the mask map texture maps to when the value of the channel is 1. A Vector4 value specifying the minimum RGBA value that the mask map texture maps to when the value of the channel is 0. The mask map texture used by the terrain layer. Metallic factor used by the terrain layer. Normal map texture used by the terrain layer. A float value that scales the normal vector. The minimum value is 0, the maximum value is 1. Smoothness of the specular reflection. Specular color. UV tiling offset. UV Tiling size. Enum provding terrain rendering options. Render all options. Render terrain details. Render heightmap. Render trees. Error states used by the TerrainMap. Indicates that the adjacent terrain tiles are not aligned edge to edge. No error detected. Indicates that there are two terrain tiles occupying one grid cell in the TerrainMap. Indicates that the adjacent terrain tiles have different sizes. Terrain map filter. Terrain object to apply filter to. Specifies a set of 2D tile coordinates. Tile X coordinate. Tile Z coordinate. Tree Component for the tree creator. Data asociated to the Tree. Tells if there is wind data exported from SpeedTree are saved on this component. Contains information about a tree placed in the Terrain game object. Color of this instance. Height scale of this instance (compared to the prototype's size). Lightmap color calculated for this instance. Position of the tree. Index of this instance in the TerrainData.treePrototypes array. Read-only. Rotation of the tree on X-Z plane (in radians). Width scale of this instance (compared to the prototype's size). Simple class that contains a pointer to a tree prototype. Bend factor of the tree prototype. Retrieves the actual GameObject used by the tree. The Terrain module implements Unity's Terrain rendering engine available through the Terrain component.