Tree Setup
From Blue Mars Developer Guidebook
|
|
Back to Blue_Mars_Asset_Creation
To create custom trees for Blue Mars use the following guidelines and instructions to ensure that your trees work well in the engine and keep the established look.
Installing the Leaf Generator
First unzip File:LeafGenerator.zip to the Scripts\startup folder in your 3DSMax Directory. To access it: go to utilities and click the MaxScript button (if you don't have one click the
button, increase the number Total Buttons: then find MAXScript under MAX STANDARD in the Utilities List box on the left. Now drag the MAXScript Text onto your new blank button on the right. Click OK.) In the drop down box select Leaf Generator (if it's not there you put it in the wrong directory or need to restart Max, the alternative is to click Run Script, find where you copied it and run it). The Leaf Generator will help you create geometry for your canopy. We'll come back to it in a bit.
The things we'll be creating are:
- A Trunk with branches
- Leaves
- Collisions
- LOD's
- A multisub that contains at least 3 materials
- Physics Proxy
- Trunk
- Leaves
- (optionally) Branches
- Inner Branch - this branch will be a large vertical one to add some volume to the middle of our canopy. You can simply create a plane with no segments it should be about the size of the height of the canopy (bottom of the canopy to the top of the canopy). Now just grab opposite corners and pull them up to create a good sized bend. Maybe 30 degrees. Next set up the UV's so that the map of your branch is diagonal (you may want to make it tile to create the impression of more leaves, this will be so deep in the tree no one will notice the tiling). Now the most important step for this branch is to set the Vertex Alpha to around 30. This will make the branch appear very dark in the engine. Now we'll make a medium depth branch that will act as the major volume of our canopy.
- Middle Branch - this branch should be fairly large, somewhat smaller than the inner branch but you can make it large enough to tile the texture. This branch should be made of a plane composed of 4 triangles. That way the middle can be pulled out to make a bit of a cup. This will add a lot of volume. Now just set it up like the inner branch and set the vertex alpha to about 60.
- Outer Branch - this branch is just to give variation in to the canopy and give the impression branches poking out. This one is shaped like the middle branch but it needs to have only 1 branch mapped to it (or not have noticeable tiling). The vertex alpha for this one should be set to 100.
Now let's go through the options on this rollout.
- Random Seed - the random number generator in max will output the same series of numbers every time you restart MAX (it works ok if you never exit and restart). So to get different results you need to put in a number here to work as the random seed. Keep it between 1-100, other values may work, but you really don't need them.
- Instances - This is how many instances of your leaf object you want to create. You might want to play with this for your tree but think of it in terms of how it relates to how many times you tiled your UVs. if you tiled them 4 times 100 is probably fine for a big orchard tree. If you only have 1 tile on your leaf object you'll want this up somewhere around 400. Personally I find going with the bigger leaf object with multiple tiles and only 100 instances works out the best.
- Tree Type - Right now there are 3 tree types which will duplicate your leaves in different ways. The rest of the options work differently for each type so I'll explain them separately.
- Conical - This will basically make a cone of your leaves. This makes nice cypress or pine type trees. Might want to stick to the lower tiling smaller leaf objects for this one and crank it up instances to like 300. The following is a description of how to use the options for Conical.
- Inner Radius - This will determine the interior radius of your cone, this will also be the size of the point at the top
- Outer Radius - This is how large the largest part of the foliage will be. This will be the radius of the base of the cone.
- Z Offset - The cone of leaves will be generated using the existing leaf object as the center point. So this number is HALF the total size of the foliage.
- Rotation - These values are the axis to be rotated about. To keep the normals facing away from the trunk I used the rotation of the Z axis to determine XY position values. X and Y rotation values will just rotate your foliage in place on their respective axis (in most cases keep these 0-15, anything more can end up turning your normals wrong).
- Conical - This will basically make a cone of your leaves. This makes nice cypress or pine type trees. Might want to stick to the lower tiling smaller leaf objects for this one and crank it up instances to like 300. The following is a description of how to use the options for Conical.
- Orchard - This will make a big canopy of leaves over your tree shaped like a parachute, this is a little harder to control but once you get used to how to use some of the hidden functions you can make a large variety of trees, from banyan to oak to juniper. You can get very good results with very big leaf objects with lots of tiling on these trees, or if you are doing a special case (like a bonsai scene or really gnarly tree) you can use the smaller leaves and just dump hundreds of instances into it. This has some slightly different options.
- Offsets - Again I used the leaf object as the center of the canopy so the offsets are all amount in any 1 direction to offset from the leaf object. There is one slightly hidden effect you can get with the orchard tree. If you move you leaf object from the origin you can change the radius of the curvature of the canopy. Basically this will create a parachute shaped canopy, perfect for tropical deciduous trees. If you want a tight dense canopy put the leaf object closer to the origin. I highly suggest you play around with this as you can get some really nice effects.
- Rotation - Since the orchard type tries to make a ball of leaves we need a way to limit how much of the ball is used. Rotation is the way to do that. X and Y Rotation determine how many degrees in each direction the ball will be generated, Z determines how much variation our leaves will have in the direction they are facing. 0 means they will uniformly face away from the trunk, 180 means they will face in lots of different directions. Note that they will still tend toward facing away from the trunk so if you want them to face down or in, you should change the normals to face that direction.
- Orchard - This will make a big canopy of leaves over your tree shaped like a parachute, this is a little harder to control but once you get used to how to use some of the hidden functions you can make a large variety of trees, from banyan to oak to juniper. You can get very good results with very big leaf objects with lots of tiling on these trees, or if you are doing a special case (like a bonsai scene or really gnarly tree) you can use the smaller leaves and just dump hundreds of instances into it. This has some slightly different options.
- Modified - This was a test that ended up working out pretty well for something, I just don't know what yet. Basically you just get a little more variation in the depth of the canopy. Note that this option will tend to create a box of the canopy.
