TreesPosted in Development, Production by campbell
Recently I’ve been writing a tree maker to speed up our tree creation pipeline, but generating nice looking trees turned out to be a lot harder then I expected.
Having a tree generator where you hit a button and pop out a perfect tree is the artists dream but realistically they need a lot of control as well.
The main difference between this and other tools is that it doesn’t do all the work for you.
We had to compromise in a number of areas: what we expected the artists to do by hand, amount of detail and artistic style. Also with the time limit, how good should we expect the trees to look anyway?
Enrico, Andy and myself did quite a bit of testing and finally we came up with a way to make trees!
- The tree trunk needs to have character and look interesting. They’re seen close in a number of shots, so a simple round cylinder just wont cut it. Andy hand modeled all the trunks.
- I took these models and added bounding meshes, these show the rough shape of the tree canopy.
- Same again, in this case it was interesting to add 2 sets for dense clusters.
- Now the branches need to be added as 3d curves. The radius for each point is used to set the branch width. I also tweaked blenders curve editing a bit to make this easier – (‘Smooth Radius’ in the specials menu, and handle hiding so they don’t get in the way while editing). We could make the whole tree this way, but the trunk would be too simple and the twigs would take too much time.
- Twigs! This is where the bounding mesh comes in. The ‘Fill Twigs’ option adds twigs between the bounding mesh (green) and the curves. There are options for randomness, size, joint style, generations, etc – enough so trees don’t have twigs that look the same, these blend in seamlessly with the handmade curve.
- The last step is to add leaves onto the twigs, this is interesting because you need to have heaps of twigs to fill up a space with leaves. I tried 2 other ways to add leaves, but having floating leaves looked horrible. Similar to twigs, the leaves have options for the branches they grow on: placement angle, random size/pitch/roll, etc. At the moment duplifaces are used to instance the leaves, but we hope to have them as particles eventually.
This is the python script – “Tree from curves, its in Blender SVN development repository so any recent build of blender will include it (Script Window > Wizards > Tree from Curves), however usibility hasn’t been a priority yet! I’d like to document it and add presets when I have some time.
- UV mapping
- Joint blending texture alpha blending
- Grow twigs from branches
- Fill twigs in a bounding area
- Grow leaves
- Variation – Moves the curves you add to create variants of each tree.
- Animation – Automatically creates an armature, weights, and moves the limbs using any texture as a basis for the motion.
- Stores settings on each curve so you can regenerate the mesh easily.