Use the Paint Trees tool to place trees on the 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 and customize their painting. You can paint trees with a brush or mass place trees across the entire terrain tile.
As an example, use the free Unity Terrain - HDRP Demo Scene, which has six SpeedTree models. You can also create trees with the Tree Editor (for the Built-In Render Pipeline).
To access tree painting:
To add trees to the terrain, add a tree prototype to the Paint Tree tool:
The Add Tree window has different options based on the tree you’re adding:
Bend Factor: Adjust the tree’s responsiveness to the wind 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. Trees from the SpeedTree Modeler don’t have a Bend Factor; only Tree Editor trees do. Refer to Animate trees with Wind Zones for more information.
Refer to Tree level of detail (LOD) for more information.
Cast Shadows: For Tree Editor trees. This is not editable; it lists the option selected in the tree’s Mesh Renderer > Lighting > Cast Shadows setting.
Customize tree placement and characteristics. Except for Brush Size and Tree Density, the settings apply to both mass placed trees and brush painted trees.
Property | Function |
---|---|
Brush Size | The size of the area each brush stroke covers with trees. |
Tree Density | How far apart trees must be. This limits the number of trees a single brush stroke adds. Note that the limit is by brush stroke, not area, so repeated brush strokes in the same area create higher densities. Note also that the larger the brush, the farther apart the trees, even if the density is 100. |
Tree Height | A range for tree height randomization. Use a wide range for a varied look, and a narrow range for a uniform look. To specify a value instead of a range, disable Random. The possible values are a scale of 0.01 to 2 of the tree’s original height. |
Lock Width to Height | By default, a tree’s width is locked to its height so that trees are always scaled uniformly. To specify a width, disable Lock Width to Height. |
Tree Width | A range for tree width randomization. Use a wide range for a varied look, and a narrow range for a uniform look. To specify a value instead of a range, disable Random. The possible values are a scale of 0.01 to 2 of the tree’s original width. |
Random Tree Rotation | If your tree has a level of detail (LOD) Group (for example, a tree imported from SpeedTree), use the Random Tree Rotation setting to help create the impression of a random, natural-looking forest. Disable this option if you want to place trees with a fixed rotation. |
Color Variation | The amount of random shading applied to trees. This works only if the shaderA program that runs on the GPU. More info See in Glossary reads the _TreeInstanceColor property. All trees created with Tree Editor read the _TreeInstanceColor property, because they all use built-in shaders. Some SpeedTree trees might not read it. |
Tree Contribute Global Illumination | Non-editable; indicates whether the tree asset’s Lighting > Contribute Global Illumination option is enabled. |
You can place trees across the entire terrain tile in a single action. Refer to Customize trees for painting (above) for information about customizing trees before painting.
To place trees on an entire terrain tile:
You can use the brush tools to add or remove trees that you mass placed.
You can paint trees onto the terrain with a brush.
To paint trees:
You can edit the tree’s properties before you place it, or between painting strokes. For example, for SpeedTree trees, you can change the LOD group you use when painting different parts of the terrain.
To edit a tree:
If you change an imported tree in a separate 3D modeling application, you need to refresh the tree in the Paint Tool to update its appearance on the terrain.
To update the trees, in the Terrain tile’s Inspector window, go to Paint Trees > Trees > Refresh.
Note: Trees from SpeedTree use their own shader to animate wind movement. The Unity Editor adds this shader only to trees that SpeedTree exports with the file type spm
or st8
. If you edit the trees using a different 3D modeling software and export them as fbx
or obj
files, the Unity Editor assigns them built-in shaders, and the wind effect is lost. To preserve the wind animation, always use SpeedTree to edit and re-export SpeedTree trees.