Trees
Posted in Development, Production by campbellRecently 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.
Main Features…
- 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.
November 30th, 2007 at 8:58 pm
Wow!
Looks great!
I’m looking forward to suing this tool!
November 30th, 2007 at 8:58 pm
Sorry.. I mean’t “use” it.. not sue it..
November 30th, 2007 at 9:16 pm
Looks great!
November 30th, 2007 at 9:41 pm
Can you make a Suzanne-shaped tree/bush? :D
November 30th, 2007 at 9:44 pm
Awesome!!!
I’ve been using the TreeGen script, but this one looks way more artist and animator oriented/friendly. And that explains why the trunks appeared separated of the branches in the weekly video.
To stunning Live trees make much Power now we have ;)
November 30th, 2007 at 10:48 pm
simply awesome! wooooo…
December 1st, 2007 at 12:18 am
sue… lol
I am also really looking forward to suing this tool!
great job guys!
December 1st, 2007 at 12:19 am
Thanks for coding it Campbell, and thank you to @ndy and Enrico for testing it!
December 1st, 2007 at 12:44 am
Wow!! That is VERY nice! And, complete with armatures and texture-based animation potential? …that’s pretty freakin’ sweet. And I love the workflow, it will definitely help you to focus more on the artistic aspect.
THANKS!
I can’t wait to get some time to test it.
December 1st, 2007 at 5:37 am
i’ve crapped better trees..
December 1st, 2007 at 6:37 am
chuckster: I guess you haven’t been taking your metamucil, then. stay regular, man
December 1st, 2007 at 7:14 am
@chuckster: that’s really gotta hurt. You have my sympathy
as to the script – looks great and looking forward to trying it out
December 1st, 2007 at 7:38 am
chuckster:
Sorry to hear about your issue :(
I hope it clears up for you.
Awesome script! :)
December 1st, 2007 at 1:55 pm
Looking great!
with the apricot project looming closer…will the trees be usable for real-time game rendering?
December 1st, 2007 at 3:43 pm
Fibonacci is the key my friend.
December 1st, 2007 at 3:55 pm
metalliandy: most likely not, currently a highres foreground tree can have over 11 mil faces…
.andy
December 1st, 2007 at 6:51 pm
Hello, Peach Team, i thinking about how create a runner/clasper on any surface with retopology tool more easily. If the retopo tool have an offset parameter you can set i.e. 0.5 and for branch curves set radius 1.0 this way can fit on surface well.
December 2nd, 2007 at 2:03 am
@chuckster: Maybe you need more peaches – they’re a great laxative!… ;)
Cool script!
~epat. :)
December 2nd, 2007 at 3:35 pm
hi,
do you know this?
http://www.polas.net/trees/index.php
December 2nd, 2007 at 8:02 pm
Great tool- I was using Lsystem,but this is so much improvement. Thanks too all!
December 2nd, 2007 at 8:07 pm
Definitely an addition to my article here:
http://bchynds.com/index.php?option=com_content&task=view&id=30&Itemid=1
I’ll add it in once it hits the stable release. It’ll probably be the best one listed, since it’s functionality far exceeds the ones listed. Great work guys. :)
December 3rd, 2007 at 7:17 am
This is really cool!
The only thing I see is that it looks like some of the leaves are oriented in unlikely directions, such as straight upward. I feel like leaves are mostly facing so that their top (shiny) sides are in some way toward the sun, but they will also all point downward in some way because of gravity.
December 3rd, 2007 at 7:23 am
Check out these:
http://marko.isfoundhere.com/images/tree_leaves.jpg
in this photo you will see that most of the leaves are facing with the normals parallel to that of the camera (not random):
http://images.inmagine.com/img/mixa/mx043/mx043012.jpg
http://www.cirrusimage.com/Trees/Kentucky_coffee_tree_3.jpg
this isn’t the law or anything, and it really doesn’t matter that much, but it might make a difference.
December 3rd, 2007 at 7:00 pm
hey guys, Im really surprised so many people are interested in this ;)
some reply…
Tree’s are very low poly – because each segment is just 4 quads, they only become higher poly when they are subsurfed. Still, for a game you’d probably be better off with alpha mapped faces.
leaf placement can be improved. the random direction is a bit too much in the pics, however turning the random sliders down would do the trick ;).
Animating from textures is way cool – you can have the blend file playing, and slide the texture settings about realtime and see the tree’s motion change! – however its IS slow and its not responding to any wind direction, so baked ipo’s with some wind direction would be a great improvement.
Some people dont like the current twigs so much, and I agree they can be improved, however its not hard at all to plug new algo’s in to the tree maker (could even make them separate files and have it modular) – so if you work out a nicer auto-twig algo – we could probably include it as an option.
December 4th, 2007 at 10:12 am
HI.
IT’s a great tool. Thank you !.
I have tried it and now I use it for some of my games(3D iso) or animation trailer – movies :).
Just a little suggestion : the title of the project is “peach”, so what do you think to add an option to add fruits (like add “leaf” for exemple) ;) ?
Thank again.
December 4th, 2007 at 3:03 pm
man, I can’t wait until that’s in the main build!
December 5th, 2007 at 3:10 pm
It would be nice if we could choose a mesh that would replace the static particles of a certain mesh. Have like a Option in the menu to use a certain mesh with a textbox indicating the object. Then leaves would be easy.
December 10th, 2007 at 1:51 am
hi, just wondering if you could incorporate the ivy script into this script. It may make the tree’s more interesting and realistic.
December 22nd, 2007 at 2:39 pm
will we be getting a forest like this?
http://fc01.deviantart.com/fs17/f/2007/215/7/5/the_Forest_church_2_by_weiweihua.jpg
December 24th, 2007 at 11:22 pm
Iam dead .
I don’t know what to do ,
and don’t know how to make things perfect .
I don’t have the vision of the final thing i want to made ,
and can’t go forward with the “crap” iam try to made .
Well ,that tool looks perfect ,
i dream to use my brain to code\create something like that or anything .
I don’t know what to do with my drawings ,
iam not that good to do the stuffs ..
I thing a suicide this time of the year
go to be perfect … :)
Well i just losse my focus somewhere ,
when i currently trying to get inspirated .
That’s a great news ,even for now only for reading ..
December 24th, 2007 at 11:47 pm
will we be getting a forest like this?
http://fc01.deviantart.com/fs17/f/2007/215/7/5/the_Forest_church_2_by_weiweihua.jpg
I might be wrong but if I remember right that was not a render, but painted in 2D. On the other hand this can be done now too, all you have to do is model those trees and then use the script to add branches where you want to, or you can use a ivy generator program.
December 26th, 2007 at 3:19 pm
Cool stuff.
Keep up the good work fellas.
December 31st, 2007 at 9:09 am
That’s so cool..
January 2nd, 2008 at 9:42 am
Hi. While this way of building trees seems nice enough, I think there may be other ways as well, namely techniques from the field of algorithmic botany. As an example, a book that is a classic in this field: The Algorithmic Beauty of Plants.
January 8th, 2008 at 9:24 pm
Where can i download this from to try it out?
January 11th, 2008 at 4:41 pm
http://dryad.stanford.edu/
January 11th, 2008 at 11:54 pm
Cool. I wouldn’t mind having a “floating leaves” option, and other such options that make it less realistic, either for a more abstract style, or for eventual realtime use.
April 12th, 2008 at 10:46 pm
It sounds a good idea having inside the Blender a tool to make trees. Do you have a step by step tutorial to help us test the script?
Best regards,
Tio Ilmo
April 23rd, 2008 at 1:00 pm
A video on how to create a simple tree with this script would be very useful.
From what I can tell this script is very powerful and flexible, great work guys :)
July 12th, 2008 at 11:56 pm
very interesting post. i am not a blener user, but i am very interested in tree generators. as far as i understand this is not a part of blender yet?
it would be very interesting to see more detailed pictures,so we could compare this tool with xfrog and vue :)
anyways i am so interested it topick cos i kind of tryed to write tree generator myself, well actuualy only tree trunk generator.
here i have my blg and some alternative and crazy ideas on tree generation. (implicit surfaces for trees ) http://3dideas.wordpress.com/
and some other stuff.
btw, cogrts with big bunny, blender is stepig on big guys toes :) keep it on!
m.
July 14th, 2008 at 8:12 pm
I created a tree taller than the Empire State Building.
It fell on me.
My lawyer will be calling your lawyer.
Just kidding.
I can say ‘cool’ ‘wow’ all that stuff and it doesn’t add up to the thanks I really want to say.
Microsoft be scared, be very scared. Open Source is a fenominome like no other. It is Genisus.