I have a number of assets from the Unity Asset Store – some paid, some free. I hunt around in them for various models that I can use in scenes for my animations, such as trees and bushes. Some use the Unity Tree Editor, which have given me problems after upgrading to HDRP. Here are my current findings in this area.
My Problem
Sometimes assets have custom shaders. There is nothing wrong with that, but when upgrading to HDRP, custom shaders are not automatically updated. So I try to change the shader to a HDRP compatible shader. Normally I succeed, but for trees using the Unity Tree Editor I can often hit problems about shader compatibility. The little red exclamation marks are my first hint of problems.

Digging into the weeds [sic], it is complaining about the shader in use is not compatible with the Tree Editor. The Tree Editor then keeps offering to set the shader to Nature/Tree Creator Bark (or Leaves).

The problem is the Nature/Tree Creator Bark and Leaves shaders do not work with HDRP, so everything turns pink (unsupported shader).

The painful part sometimes coming back to a project after a while I find that trees have their material updated and I have a lot of problems setting it back again. Maybe I mis-clicked something, not sure. Recovery can involve restoring from backup if I don’t notice in time (the undo history is lost). The Tree Editor component creates the meshes and assigns the material, so direct changes I make under the covers may be overridden by the Tree Editor component when it feels appropriate.
Further, if I do manage to change the material to use say the HDRP/Lit shader, I get errors like this in the console.

Unity appears to have hard coded a number of shader properties it expects to have, but I have not found a documented list of such properties.
So this blog post is my quest to avoid these problems so I can reuse trees and bushes from various Asset Store purchases, upgrade them to HDRP, but without risk of the model failing in the future.
Tree Editor, Tree Creator, Tree Builder – what’s the right name?
The first thing that caused me some confusion is references to Tree Editor and Tree Creator (and sometimes Tree Builder). For example, the current Unity documentation and source code uses Tree Editor, but the shaders are called Tree Creator (Tree Creator Bark, Tree Creator Leaves Fast, Tree Creator Bark Optimized, Tree Creator Leaves Optimized).
From my reading, Tree Creator used to be a separate package. It was merged into the core of Unity, and at that time it was renamed to Tree Editor. So Tree Creator (the external package) is no longer supported, but Tree Editor is. Kind of. E.g., it does not support HDRP and no active development seems to be taking place, but it is a documented feature.
Part of my confusion is from this forum thread on Tree Creator and HDRP. Down the thread it says “Tree Creator is abandoned” and points off to comments on an issue – but I am wondering if what it really means is the external Tree Creator package is no longer supported, instead Tree Editor should be used instead.
As a side note, the Tree Editor documentation also mentions SpeedTree. This used to be an separate service for creating trees that Unity purchased. It can generate high quality trees, but as a paid service (you can buy individual assets or a subscription).
And finally, “Tree Builder” I think is people sometimes remembering the name wrong… I hope! I have never tracked down any actual code or asset for this.
Trunks, Bark, Branches, Leaves, and Fronds
To be honest, I am not sure I have this completely right. Tree Editor has the concepts of branches, leaves, and fronds. It also has broken branches. But there are also mentions of bark and trunks. The following is how I think it works.
- Trunk I think is just a branch, but it’s the starting branch that other things connect to.
- There are bark shaders. That is, you can put a bark shader on a branch (including the “trunk” – you might use a different shader on smaller branches).
- Leaves often have a different shader as they often flutter around more. They tend to be placed on the tips of branches.
- Fronds are different in that there is a branch with leaves off the side of the branch all the way along like a palm leaf or fern. So they should move like branches, but can have some movement on the edges.
Optimized Shaders
For a shader to be considered “acceptable” for Tree Editor to include in its list of shaders you can apply, it has to have “Bark” or “Leaves” in its name, and it has to have a dependency on an optimized shader. The only problem is, I cannot find a documented description of what an optimized shader is! Why are two shaders needed?
For example, the Nature/Tree Creator Bark has a reference to Hidden/Nature/Tree Creator Bark Optimized. Why? No idea! I believe however it uses the optimized shader referenced to do the actual rendering. Again, I have not found much documentation on this.
Writing your own shader
One idea I had was to create a HDRP shader graph compatible with Tree Editor. Define all the extra properties that Unity expects on trees in that shader. I looked at console warnings about unknown properties and added them all as shader graph inputs. This worked pretty well (up to a point). All the warnings stopped, and it could render the branch or leaves.
Clicking on a Nature/Tree Creator Bark shader, you can see a list of properties it supports as well if you want to give this a try yourself. (Note that it actually uses the Hidden/Nature/Tree Creator Bark Optimized shader when you pick the Nature/Tree Creator Bark shader in the Tree Editor tool. This is the shader referenced as a dependency.)

The problem I hit was the Tree Editor refused to accept the Shader Graph I created because there is “no dependency on an optimized shader in the source code”. This also happens when trying the SpeedTree shaders. (Wouldn’t it be nice if SpeedTree shaders from Unity were compatible with Tree Editor from Unity…)

Okay, so I have a shader graph and now need to add a dependency to the source code of my optimized shader. Ummm. What source code? It’s a shader graph. I have not worked out how to define a dependency with Shader Graph yet. Please leave a comment if you know the answer here. (The Nature/Tree Creator Bark shader for example has a dependency line here, but that is not defined using shader graph.)
Third Party Tree Shaders
There may be third party shaders that are compatible with Tree Editor. For example, The Vegetation Engine lists support for Tree Engine (but not billboards, which are used for objects using LOD (level of detail) support). I have not tested it, but it may be that shader will appear as a supported shader, meaning it is safe to leave the Tree Editor component on the tree. There may be other similar shaders around, but that may require purchasing and testing more shaders. (Again, feel free to leave a comment and I will include them on the list here.)
The Vegetation Engine actually looks quite interesting in that it has got a good wind implementation (it would be hard to be worse than mine!). It can also have grass part to the sides as a character walks through, or trees can bend over when a car hits it.
UPDATED: March 16, 2023: The Vegetation Engine kindly sent me a copy of their shader to test with. Installation and some quick testing it looks pretty slick. However their shader does not appear in the list of Tree Editor shaders. So you can convert a Tree Editor tree over by replacing the material shader, but you will get the same red light warnings as above.
Removing Tree Editor
While I was looking at The Vegetation Engine and visiting their Discord server, I got a useful tip from Ty Xanders (CEO of HIBIKI entertainment). You can remove the Tree Editor component using the following steps:
- Create your own tree, or locate one in an existing project.
- Put the tree into a scene hierarchy.
- Drag the tree into the Project window to create a prefab (even if you had one before).
- Open the prefab and remove the Tree Editor component.
I think the reason this works is putting the tree into the scene hierarchy causes the Mesh and Mesh Renderer components to be instantiated. Dragging into your project window and creating a new Prefab will then save those cached components. Deleting the Tree Editor component means it will never be possible to edit the tree again, but for me that is a bonus. It is now just a model with a mesh and mesh renderer, meaning you can change the materials etc as you like.
Reusing Trees in Different Projects
In my case, I create a new project per location in my animations. I often want to use some of the same trees and bushes, but I don’t want to add the entire asset sometimes as Unity starts to slow down. (Some of the assets are BIG!) Two approaches that I am still exploring:
- Use the Unity Package Exporter per tree prefab. The exporter has an option to “include dependencies” so it automatically picks up the tree prefab, referenced materials, textures, and so on – all the assets indirectly referenced by the prefab. Watch out for other scripts sneaking in (the exporter cannot detect such dependencies reliably). The exported package you can then import into other projects. If you import several trees that came from the same project sharing shaders etc, the shared assets will not be duplicated. The path names in the project will be from the original project as well if you want to work out where you got it from.
- The Vegetation Engine had another nice tool which allows you to collect all the assets used by a tree, apply their shader, and export to a new prefab with a new copy of all required assets in a local directory with the prefab. This can avoid the risk of updating a shared material. A nice little bonus.
Other reading
Some other sources of information I came across that might be interesting to others:
- Forum thread talking about built-in shaders for foliage.
- A YouTube video Creating a Foliage Shader in Unity URP! Grass, Trees, Flowers, Hedges and More | Game Dev Tutorial. Talks about URP, but it looks pretty good.
- QFX Terrain is shader for rocks on ground in terrain which looks pretty nice.
- Tree Editor source code on GitHub (and related files like TreeEditorHelper.cs) was interesting to browse around and see that it was checking the dependency existence via shader.GetDependency() in order to decide whether to show the shader as an option or not. If you know how to add a dependency with shader graph, please let me know!
Conclusions
For me, The Vegetation Engine looks interesting, but I will probably start with just using the approach above to remove Tree Component from prefabs I create from assets I take from existing purchases. That will let me reuse trees and bushes across locations without too much inefficiency.
Did I get something wrong? Almost certainly! Please leave a comment and help make this a more useful resource!