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.
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.