A TerrainThe landscape in your scene. A Terrain GameObject adds a large flat plane to your scene and you can use the Terrain’s Inspector window to create a detailed landscape. More info
See in Glossary might have grass clumps and other small objects (such as rocks) covering its surface. Unity renders these objects using textured quadsA primitive object that resembles a plane but its edges are only one unit long, it uses only 4 vertices, and the surface is oriented in the XY plane of the local coordinate space. More info
See in Glossary or full meshes, depending on the level of detailThe Level Of Detail (LOD) technique is an optimization that reduces the number of triangles that Unity has to render for a GameObject when its distance from the Camera increases. More info
See in Glossary and performance you require.
Instancing details work with all render pipelinesA series of operations that take the contents of a Scene, and displays them on a screen. Unity lets you choose from pre-built render pipelines, or write your own. More info
See in Glossary, including the High Definition Render Pipeline (HDRP).
Terrain details are available in several modes, where each mode has a different use during game development.
Mode | Description |
---|---|
Instanced mesh | Unity recommends you use this mode because it’s best suited for most scenarios that require the placement of any number of arbitrary meshes on Terrain. To add an instanced mesh, select Add Detail Mesh and enable the Use GPU Instancing option. |
Vertex Lit mesh | Doesn’t use GPU instancing for rendering. Instead, it combines all detail instances into one mesh, which results in simple shading and limitations to the number of instances you can achieve. To add a Vertex Lit mesh, select Add Detail Mesh and set the Render Mode to Vertex Lit. |
Grass mesh | Works similar to the vertex list mesh, but Unity treats these meshes as grass so they always have up-facing normals and move in the wind. To add a grass mesh, select Add Detail Mesh and set the Render Mode to Grass. |
Grass Texture | Lets you create grass quad meshes directly from Texture, which move in the wind. You don’t need to specify any custom meshes, and there’s also an option you can enable to make grass quads always face the camera for a billboard effect. Select Add Grass Texture for this option. |
To enable grass and detail painting, select the Paint Details button on the Terrain InspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info
See in Glossary toolbarA row of buttons and basic controls at the top of the Unity Editor that allows you to interact with the Editor in various ways (e.g. scaling, translation). More info
See in Glossary.
To access Paint Details from an overlay:
Initially, a Terrain has no grass or details available. In the Inspector, click the Edit Details button to display a menu with the Add Detail MeshThe main graphics primitive of Unity. Meshes make up a large part of your 3D worlds. Unity supports triangulated or Quadrangulated polygon meshes. Nurbs, Nurms, Subdiv surfaces must be converted to polygons. More info
See in Glossary and Add Grass Texture options. Click either option to bring up a window that lets you choose Assets to add to the Terrain for painting.
Use the Detail PrefabAn asset type that allows you to store a GameObject complete with components and properties. The prefab acts as a template from which you can create new object instances in the scene. More info
See in Glossary field to select a Prefab from your Project. To create an authentic look, a random factor affects each mesh to determine the size and color. Unity uses the Perlin noise algorithm to generate such random factors.
The Min Width, Max Width, Min Height, and Max Height values specify the upper and lower scalings along the X and Y axes with which the meshes are randomly generated.
The Align to Ground (%) value specifies how much the detail axis aligns to the terrain normal. 0 is unaligned, and 100 is aligned to the normal.
The Position Jitter (%) controls the randomness of the detail distribution from ordered to random. This is only available when legacy distribution is turned off in Quality settings.
The Noise Seed setting sets the random number generator seed. Each seed value represents a unique generation. If you set the same seed for two types of details, the generated instances become identical. The Noise Spread value refers to the scaling of the noise pattern over the X-Z plane, with higher values indicating more variations within a given area.
The Hole Edge Padding (%) setting controls how far away detail objects are from the edge of the hole area. For more information, see DetailPrototype.holeEdgePadding.
The Detail Density value controls the detail’s density relative to its size. You can enable this in “Coverage” detail scatter mode, set in Terrain Settings.
Healthy Color and Dry Color settings control the color variation. Unity performs linear interpolation between the healthy and dry colors, and selects a color based on the size of the mesh. For example, the system considers bigger-sized meshes to be healthier. The linear interpolation results for such meshes lean more towards the Healthy Color tint. These color settings disappear when you select Use GPU Instancing because they have no effect on instanced meshes.
The Affected by Density Scale checkbox determines whether the Detail Density Scale setting set in the Terrain Settings affects this detail.
You can set the Render Mode to Vertex Lit or Grass.
Render Mode | Description |
---|---|
Vertex Lit | Renders detail meshes as solid, vertex lit GameObjectsThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info See in Glossary in the sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info See in Glossary, which don’t move in the wind. |
Grass | Renders detail meshes in the scene with simplified lighting similar to Grass Textures, and do move in the wind. |
Note: To apply a texture on a detail using Vertex Lit or Grass render mode, assign a texture to the MainTex material property (default property name for Base Color Map in built-in/URP). No other material properties are considered for non-instanced details.
You can specify if you want to use GPU instancing to render your detail meshes. With GPU instancing, Unity uses the material and the shaderA program that runs on the GPU. More info
See in Glossary specified on the prefab for rendering. This lets you perform more customization in the shader and use Shader Graph.
Unity still applies the Width and Height noise to each instance, but disables the Healthy Color/Dry Color noise. You can use your own color variation technique, along with other randomizations, in the shader.
Under the hood, some Unity GPU instancing limitations do affect rendering. For example:
Unlike regular instancing where Unity dynamically builds up the instancing constant buffer every frame, instancing details have persistent constant buffers for better CPU and GPU performance when the target hardware allows for it, at the cost of moderately increased GPU memory usage.
If you select Use GPU Instancing, the Render Mode setting becomes grayed out and unavailable.
The Add Grass Texture window
Detail Texture is the Texture that represents the grass. You can download Textures from the Asset StoreA growing library of free and commercial assets created by Unity and members of the community. Offers a wide variety of assets, from textures, models and animations to whole project examples, tutorials and Editor extensions. More info
See in Glossary, or create your own Textures. A Texture is a small image with alpha set to zero for the empty areas. Note that “Grass” is a generic term; it’s possible for a Texture to represent flowers or man-made objects such as barbed wire coils.
The Min Width, Max Width, Min Height, Max Height, Noise Seed, Noise Spread, Hole Edge Padding (%), Align to Ground (%), Position Jitter (%), Detail Density, Affected by Density Scale, Healthy Color, and Dry Color settings work the same as they do for meshes. The Add Detail Mesh section above provides more details.
When you enable the BillboardA textured 2D object that rotates so that it always faces the Camera. More info
See in Glossary option, the grass images rotate so that they always face the CameraA component which creates an image of a particular viewpoint in your scene. The output is either drawn to the screen or captured as a texture. More info
See in Glossary. This is useful when you want to display a dense field of grass because clumps are two-dimensional, and not visible from the side. However, with sparse grass, the rotations of individual clumps might become visible, which could a strange effect.
To remove a detail, select the detail to remove, click the Edit Details button, then select Remove. When you remove a detail, Unity clears the data that represents the Terrain area on which you scattered that detail.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising. Some 3rd party video providers do not allow video views without targeting cookies. If you are experiencing difficulty viewing a video, you will need to set your cookie preferences for targeting to yes if you wish to view videos from these providers. Unity does not control this.
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.