Version: 2020.2
Wind Zones
Working with Heightmaps

Grass and other details

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. Each LOD level has either a Mesh with a Mesh Renderer component (Mesh LOD level) or a Billboard asset with a Billboard Renderer component (Billboard LOD level). Typically a single GameObject has three or four Mesh LOD levels and one optional Billboard LOD level to represent the same GameObject with decreasing detail in the geometry. More info
See in Glossary
and performance you require.

Note: Grass and other details currently only work in the built-in render pipeline and Universal Render Pipeline (URP).

Terrain with grass
Terrain with grass

You can enable the BillboardA textured 2D object that rotates as it, or the Camera, moves so that it always faces the Camera. More info
See in Glossary
property of a textured quad so that it automatically faces the camera. This is a very common way to achieve a good grass effect in game development.

For detail Meshes, you can set the Render Mode property as either Vertex Lit or Grass.

  • Select Vertex Lit to create Meshes that are vertex lit with real normals, which do not move in the wind.
  • Select Grass to create Meshes that are vertex lit using Terrain normals, which do move in the wind.

Enabling details

To enable grass and detail painting, select the Paint Details button on the 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
.

Paint Details in the Terrain Inspector
Paint Details in the Terrain Inspector

Initially, a Terrain has no grass or details available. In the Inspector, click the Edit Details button to display a menu with the Add Grass Texture and Add Detail Mesh options. Click either option to bring up a window that lets you choose Assets to add to the Terrain for painting.

For grass, the window looks like this:

The Add Grass Texture window
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 is possible for a Texture to represent flowers or man-made objects such as barbed wire coils.

The Min Width, Max Width, Min Height, and Max Height values specify the upper and lower size limits grass clumps that are generated. To create an authentic look, the grass is generated in random “noisy” patterns with bare patches interspersed.

The Noise Spread value controls the approximate size of the bare and grassy patches, with higher values indicating more variation within a given area. Unity uses the Perlin noise algorithm to generate noise, and Noise Spread refers to the scaling it applies between the x,y position on the Terrain and the noise image. The alternating patches of grass are considered “healthier” at the centers than at the edges, and colors set in the Healthy Color and Dry Color settings represent the health of the grass.

Finally, when you enable the Billboard 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 show 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 apparent to the viewer, creating a strange effect.

For detail meshes such as rocks, the window looks like this:

The Add Detail Mesh window
The Add Detail Mesh window

Use Add Detail Mesh to select a 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
from your Project. Unity scales this randomly between the Min Width and Max Width values, and the Min Height and Max Height values. Unity uses width scaling for both the x and z axes, and height scaling for the y axis. The Noise Spread, Healthy Color and Dry Color values work the same as they do for grass.

You can set the Render Mode to Vertex Lit or Grass.

  • In Vertex Lit mode, Unity renders detail objects 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
    .
  • In Grass mode, Unity renders instances of detail objects in the Scene with lighting, in a way similar to grass.

  • 2019–11–25 Page amended

  • Added information about render pipelines

Wind Zones
Working with Heightmaps
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961