First of all, I apologize if a thread on this topic already exists. Feel free to link me to it.
I've done a search of this forum and google and while I find occasional discussions on the subject, I haven't found a source that provides definitive information. For instance, I have found advice regarding tree tri-counts really ranges. Are there tri-counts that are common and expected for trees, or is it mostly dependent on the nature of the project and the use of the tree (like other meshes)?
Also, I'm curious to know if there are any industry standard practices for producing best results, especially for procedurally generated trees. What is the best way to flesh out and fill out the crown of a tree? What is important to consider when creating convincing shaders for bark and leaves? Are there any pitfalls that are common that I should be careful to avoid?
Feel free to connect me with any favorite tutorials. Thank you for your time!
Replies
http://wiki.polycount.com/CategoryEnvironmentFoliage
3dmotive has a good tut on foliage creation
speedtree is a program good for that and theres plugins for max etc.
those kinds of things should be on the wiki if i remember correctly
im actually curious on finding out about any good bark texturing/shader tutorials as well.
Crown depends on the tree type, but sometimes it helps to add a specific alpha texture to your sheet for the crown pieces. Like a scraggly branch texture for the top of a pine tree, place three or four of those at the top and it looks pretty good. Can also reuse that lower on the trunk for dead mini-branches.
For a forest, it is helpful to reduce the drawcalls, which usually means packing all the textures into a single sheet and using a single shader for the whole tree. The bark can be tiled, and the mesh can be subdivided everywhere the texture tiles, so you can split the UVs there. Or you can layout the texture so the bark runs vertically all along one edge of the texture sheet, so it tiles vertically.
Bending the vertex normals can help a ton with tree shading. I put some stuff here. http://wiki.polycount.com/VertexNormal#Foliage_Shading
A common pitfall I've seen is to make trees totally straight. Another one is to use crappy shading. Another is to not add dead branches, which can add a lot of naturalness to trees. Another is to use an alpha that is too dense... alpha works best when foliage has a lot of empty space between the leaves, especially for the mips (distance filtering) but also for dynamic shadowing, and silhouette.
A big help is to closely examine the trees in a game you like, try to figure out how they're made. Load them in the game editor, or use a 3d extractor to grab models and textures.
http://www.deep-shadows.com/hax/3DRipperDX.htm#Overview
Check out the source sample assets for vegetation, it might give you a few leads.
Also, check out this one from the wiki page Macattackk posted...
Vegetation Procedural Animation and Shading in Crysis - by Tiago Sousa
A detailed overview of Crytek's process for vegetation shading.
Just to echo what Eric said, pick some foliage of a game you really like and start breaking it down and figuring out how they went about each step.
When I started using CE2 a few years back, I could not get over how awesome the vegetation was in Crysis. I pretty much focused all my hours on trying to reverse engineer their trees, grass, bushes, etc and time after time I produced crap. I'm talking vomit inducing stuff here BUT! I learned a ridiculous amount with each "failed" attempt.
If you can find a game that has an editor and viewable assets and textures, such as Crysis 1/2, everything becomes a lot clearer. When you try and recreate a piece of foliage you saw in a game that you can only examine when in-game, it's a bit like trying to feel your way through the dark. It's still doable but it'll most likely take a lot more trial and error to get on the right path.
The tricky part is to create good looking branches textures, leaf clusters and so on. This is biggest time sink to get them right.
And there are few options:
1. Take camera, go to forest, cut some branches of tree, take photos on them. Easiest way, giving nice results.
2. Grab an reference of branch, model it,and bake it. You can use spline to model trunks, and then particle system to distribute leaves, or object paint to paint leaves. In my honest opinion both are equaly bad, and you will have to adjust all leaves manualy anyway. But at least they are placed.
3. Buy yourself an GrowFX plugin for 3ds max. It's about 300$. Not as ridiculusly expensive as SpeedTree. Not a cheapest thing either (depending where you live and what are you doing anyway).
It's high-poly L-System modeling for any foliage you can or can't imagine. I've been using it to grow small branches, and then bake them.
Except for point 1 it's easiest and fastes way to produce tree. It might look compilated at start and it take some time to learn it, but after all is not that hard. IMO it's best foliage modeling tool on the market.
As for other tips:
1. Do no try to model realistic tree. You will fail badly each time. And it will never look good in game.
1a. Trees should have enough negative space to cast nice shadows, and allow sun to cast nice sun-rays when you look trough tree. In real world, trees(especially bigger ones) are pretty solid and cast pretty solid shadows. Try to avoid it as much as possible.
That's for theory. Now I'm going back to 313 failed tree attempt
This is IMO the best way to go. I've worked hard to get the other approaches to work well, but they just don't cut it. We have a tutorial here from a super-talented team member in China, she uses exactly this approach, and the results are excellent. I wish I could share it. I'll ask.
In the end, no matter which way you approach it, you just end up needing artistic talent to make good-looking real-time trees. I think a lot of the challenge for people is in designing the composition, the layout and pruning of the tree.
Also, the branch tool is pretty nifty, it saved me so much time compared to when I would hand tweak my branches from splines.
Ryan's treegen script (3ds max) has also come in handy: http://www.polycount.com/forum/showthread.php?t=93240
To touch on what Eric said regarding composition, observe what ever plant you're making and try to determine how it's grouped:
- Main branch that everything grows from.
- Smaller branches that grow from the main.
- Even smaller Branches that hold the leaves.
- Leaves on smallest branches.
Here's an example of how you can create a few groups of leaves and paint them on the correct branches to create the entire tree branch:
Wow, thank you for all the tips, links and feedback! I'm going to go through all this information with a fine-tooth comb.
But I wanted to say thanks first! This is AWESOME!
iniside: "Do no try to model realistic tree. You will fail badly each time. And it will never look good in game." By this, I presume you mean a game artist should not try to recreate a tree from nature exactly (for instance, from photographic source), but use the source as a general idea for the basic tree shape/ properties. Since trees are so complex, this makes a lot of sense to me. However, I find this advice interesting considering that, in my experience, when it comes to other meshes, the artist's goal is usually to try to match the photo or concept art as exactly as possible. Are trees usually treated as exceptions to this standard, or does it really depend on the project?
On another note, I'm intrigued by this concept of building and baking branches. Using photograph branches seemed like a natural first option, but I could see a benefit to building and baking your own... for presumably more accurate normal and ao results?
Eric Chadwick: Thanks for all your feedback! I would be curious to see your colleague's tutorial, if possible.
I suppose making 3D trees requires much of the artistry of a bonsai master!
Bunglo: Wow, thanks for providing visuals. This really helped me understand some key points being discussed. Working from small to large makes a lot of sense.
Thanks again, to everyone!
For a good silhouette and an alpha that isn't too dense, you want a flat wide branch with few overlapping leaves. Not easy to find.
Making a normal map from a photo can look OK, but it's not sharp and clean like geometry.
iniside's suggestion about not modeling a realistic tree is nonsense. Take a look at this forest mod.
http://www.crydev.net/viewtopic.php?t=44230
Problem with trees is that, if you want to model exactly what you see, you will far exceed any resonable poly count for game.
Of course let's say Caucasian Spruce have very characteristic look and you want to catch it as close as possible, but if you overdo, you will end up with messy mesh that doesn't look intresting, and doesn't add any intresting lighting effects to scene.
It's all about making good looking branches (or leaf clusters). If you have done them, 80% work is done, and rest is just fun.
I disagree. Those as far from what I consider as realistic. You should try catch general tree shape, and make it look intresting in first place.
Unless you think that by not realistic I mean trees bended in 720 degree angles in all directions
you can create your leaf texture with it and your tree for your game
http://www.scriptspot.com/3ds-max/scripts/avizstudio-tools-atree3d