Converting polygon model to Unity Tree. Is it possible?

Is it possible to import a modeled 3D tree into Unity and set it up so that it works like the native Unity trees i.e. can be painted on terrains, reacts to wind, and changes to a billboard at a certain distance.

In the following article in the Unity Reference Manual it clearly states that trees can be created in this way, so I know that it is possible. However the article doesn’t explain the process very clearly.

Is there a common workflow for this? Has anyone managed this successfully?

It is, but there are quite a few steps involved to get the trees working correctly:

  1. Model your tree (any 3D package able to export to .fbx)
  2. Assign two materials to your tree - one for the leaves, one for the trunk
  3. Export your model as .fbx. Unity recommends to not exceed 2000 triangles (NOT polygons) per tree. Also take note of what units you are using.
  4. In Unity, create an “Ambient Occlusion” folder
  5. Import your tree assets into this folder
  6. Adjust Ambient Occlusion settings as necessary
  7. Assign textures to your materials. Make sure you use the Nature/Soft Occlusion Leaves and Nature/Soft Occlusion Bark shaders or your tree won’t react to the wind (among other things)
  8. Create an empty gameobject. Add a Mesh Filter & Mesh Renderer
  9. Assign the relevant mesh, remember to change the number of materials to 2 (in inspector), otherwise your leaves will not show up
  10. Add a collider to your tree if you wish
  11. Create a prefab. Drag the gameobject onto the prefab
  12. Done!

Now simply create a terrain and paint/place your new tree (remember to change the bend factor from the default “0”). If you can’t see your tree when painting etc, adjust the scale factor in the inspector and try it again.

My solution is as follows:

  1. import your tree into
    Assets > Standard Assets > Terrain Assets > Tree Ambient-Occlusion > Your sub folder name
    (NOT just a folder whose name contains “Ambient-Occlusion”)
  2. Assign the Nature/Soft Occlusion Bark or Leaves Shader, and adjust the main color of the leaves to pure white (otherwise the leaves will show up black and opaque)
  3. No need to add empty gameobject and then mesh filter or mesh renderer because when imported into the folder in 1), Unity to know how to set it up correctly.
  4. edit terrain in inspector, add your tree and set up bend factor, and paint tree
  5. add wind zone and play. Done

(I am using Unity 4)

If you want to import custom made trees and still benefit from advanced bending and lighting functions such as offered by the tree creator shaders you may give the custom tree importer script a try.
It lets you import manually modeled trees from 3d Apps like Maya, 3ds Max, Modo or Blender and adjusts them to be compatible with unity’s advanced tree creator shaders and directional and radial wind zones on the fly: