| Spring
Foliage
Ted Boardman tedb@tbmax.com
http://www.tbmax.com
Well,
spring is actually coming to the seacoast of New Hampshire. Most
of the snow is gone from my back yard and a crocus or two have popped
out in a flash of color.
With
spring being a time for foliage, we may as well take a look at a
quick method I use to create relatively low polygon foliage that
looks fine in the distance and from directly above and casts inexpensive
shadows.
There
is no shortage of options to generate foliage for indoor and outdoor
scenes in 3ds max or VIZ, but they always require a compromise.
These trees and shrubs are no different, but do offer another alternative
that can be used alone or mixed with other mapped or modeled for
a wider variation of foliage in your scene. New foliage can be created
in a matter of minutes and require no plug-ins. Remember, the keyword
here is efficiency and flexibility.
Here
are two images showing some typical foliage used in a couple of
scenes in which I was copying two watercolor paintings I had seen
recently. The tree in the street image on the left and several of
the deciduous and fir trees in the stream image on the right of
Figure 1 were created in several minutes. As a side note, the street
scene was done in 7 hours and the stream scene was done in 5 hours,
mostly as exercises in EditablePoly modeling in max 5.

Figure 1: Low polygon deciduous and fir trees used in two scenes.
Generic
Deciduous Trees
This
tree will initially be made of two objects, the trunk and the foliage.
These two objects will then be attached with the option of creating
a Multi/Sub-object material from the separate materials for the
trunk and the leaves.
I’ll
run through the fundamental process for both the modeling and the
materials, keeping in mind that efficiency is paramount. If you
need realistic trees, then you’re better off with one of the
third party packages that will generate them.
I’ll
create these examples in VIZ 4 and have Jeff post them on cgarchitect
so they may be loaded in either VIZ or max if you want to view them
more closely. In max 5 the Editable Poly tools are slightly different,
but function the same.
I’ll
just walk you through the steps I use to make the trunk and I recommend
that you re-create your own examples using any variations that fit
your needs.
The
trunk starts with a Cylinder primitive 1 foot in Radius, 12 feet
in Height, 12 Height Segments, 5 Sides, and Smooth turned off. I
then right-click on the Perspective label and enable Edged Faces.
I then right-click on the object and choose Convert to Editable
Poly. Name this object Trunk
Hit
the F2 key to turn on Shade Selected Faces. In the Modify panel,
go to Polygon sub-object mode and select a polygon about 2/3 of
the way up the trunk. In the Edit Geometry rollout, click the Bevel
button, pick on the select polygon and drag a branch with a slight
bevel taper. Repeat to make another segment to the branch. At Vertex
level move the vertices to make a branch. See Figure 2.

Figure 2: Use sub-object Polygon Bevel and sub-object Vertex mode
to create a branch.
Repeat
the last process to make two more branches higher up the trunk.
In Vertex sub-object mode, move vertices near the base to flare
the base out somewhat. You may need to select vertices in one viewport
and move in another to see what you are doing. See Figure 3 for
the results.

Figure
3: Create two more branches and flare the base of the trunk somewhat.
Exit
sub-object mode and, in the Surface Properties rollout, check the
Use NURMS Subdivision option. Increase the Iterations to 1. This
adds polygons and rounds the tree for a more organic look. See Figure
4.

Figure 4: Use Editable Poly’s built-in NURMS Subdivision with
an Iteration of 1 for a more organic trunk.
The
trunk is now reasonable looking, but if you right-click on it and
look in Properties you will see that it has 86 faces (in my example).
Right-click on the trunk and choose Convert to Editable Mesh. Check
the faces count again and you will see it is actually 692 faces.
This is the number of faces the renderer will see. While that may
not seem like a lot, by the time you create a forest it could have
a significant effect on your render times.
Select
the trunk and, in Modify panel, Modifier List, choose Optimize modifier.
In the Parameters rollout enter 12 in the Face Thresh: field. This
drops the count to 352 without destroying the form of the trunk.
Right-click and Convert to Editable Mesh again. You can reduce more
faces by deleting the bottom faces at the base of the trunk, in
my case another 22 faces for a total of 330. Your trunk may be different
but you get the picture.
The
foliage is created with a series of steps in which you first create
a canopy, then scatter very simple triangle “leaves”
over the surface. It is important to keep in mind how the Scatter
compound object functions. You pick an object to use as distribution
object which generates a new clone of the mesh over which the actual
leaf object is spread. You must both hide the distribution clone
and delete the original distribution object to be able to see through
the leaves.
The
Canopy
I started
here by creating three Geosphere primitives that I positioned around
the trunk to simulate a canopy of leave. I then convert one of the
Geospheres to EditableMesh and Attach the others to it, for a single
object. See Figure 5.

Figure 5: Create Geospheres and attach them together as a single
mesh to use as a canopy for the tree.
To
create less of a regular “lollypop” form, I apply a
Noise modifier with 5’0” in each Strength field and
40 in the Scale field. Note that for Noise to affect objects, the
object must have sufficient vertices and the Scale number must usually
be lowered from the default 100. See Figure 6.

Figure 6: Attached Geospheres with Noise modifier to “randomize”
the canopy.
At
this point I usually convert the canopy to EditableMesh, but that
is optional. The shape and size of the canopy is, of course, dependant
on the type of tree you are trying to represent. Sometimes I will
use several separate objects clustered around the branches that
may or not be somewhat flat, or I might use a tall conical object
to start.
The
Leaf
Here
I’ll start with a single leaf that will have a material applied.
The leaf is created from an Ngon shape with 3 sides and a radius
of 8 inches.
Note:
The most important point here is that the shape is created near
the base of the tree. There is a relationship between the pivot
point of the leaf and the surface that it will be scattered on.
If the pivot points are too far from each other an offset from the
surface can develop and the leaves will be far from the canopy.
Select
the shape, right-click on it to convert it to EditableMesh. This
creates a single face surface with no thickness.
The
Leaf Material
In
the Material Editor, change a Sample Window from Standard to Double-Sided
material type. See Figure 7. You can “Keep the Old Material
as Sub-Material”.

Figure 7: A Double-Sided material applies two materials to a surface
based on the Face Normals.
Note:
this is not the same as a 2-sided material. Double-Sided materials
contain two materials, one applied to the side of a face with the
Face Normal and another that is applied to the backside of the face.
This allows much more flexibility in how the leaves look. The effect
must be rendered to be seen as only the first material will show
in the viewports.
Set
the Diffuse color to a light green in the first material and an
orange in the second material Diffuse color. This will enable you
to see the effect and you will make more adjustments later. Assign
this material to the leaf object you have just created.
Scattering
the Leaf on the Canopy
Select
the triangular leaf object at the base of the trunk. In the Create,
Geometry menu, drop below Standard Primitives to Compound Objects.
Click the Scatter button.
In
the Pick Distribution Object rollout, click the button of the same
name. In a viewport, pick on the canopy object. The color of the
canopy will appear to change, but that is just the new distribution
object being created. There is also one leaf applied to the new
object.
In
the Scatter Objects rollout, enter 1000 in the Duplicates field
and you will see 1000 of your triangular faces randomly scattered
over the surface. It is actually the pivot point of the leaf that
is on the surface.
In
the Display rollout, check the Hide Distribution Object option.
In a viewport, select the Geosphere canopy and delete it, you no
longer need it. You will, however, still be able to adjust the number
of leaves scattered.
Render
the scene. If you have a ground plane and a shadow casting light
you will see something similar to Figure 8. The tree appears as
you would suspect, triangles randomly surrounding a trunk. You will
fix that.

Figure 8: The tree so far with a ground plane and shadow casting
light. The leaves are clearly triangles and not very convincing,
yet.
In
the Scatter Object rollout, enter 10 in the Vertex Chaos field.
This randomly moves the vertices of each triangle to make a more
irregular pattern. See Figure 9. There are also controls in the
Transform rollout that will increase the randomness of the placement
and size of triangles.

Figure 9: Increasing the Vertex Chaos setting will make the leaves
more random in size. You also have controls in the Transform rollout
for this purpose.
Adjusting
the Material
The
severely triangular nature of the scatter leaves won’t convince
even the most forgiving client. You will next apply a very strong
bump map to each material to detract from the visibility of the
edges of the triangles.
In
the Material Editor, enter 300 in the Bump Amount field and apply
a Noise map to the Bump slot of the first material in the Double-Sided
material. In the Noise Parameters rollout, set the Size of the map
to 3. Enter 0.8 in the High Threshold and 0.2 in the Low Threshold
fields for a more contrasting Noise map. Using the Material/Map
Browser you can now drag and drop this map into the Bump map slot
of the second material in the Double-Sided material. Use the Instance
option. Also, remember to set the second material’s Bump Amount
to 300.
Render
the scene and the leaves will have a much more random chaotic look.
See Figure 10.

Figure 10: Applying a very strong Bump map to both the Double-Sided
material levels will detract from the noticeable edges of the triangular
leaves.
Once
you have finished adjusting the leaf count and placement, it is
a good idea to convert the leaves to an Editable Mesh object to
reduce the overhead of the Scatter operation.
Create
and assign a new material for the tree trunk. Here, I’ve used
a simple Noise map in the Diffuse color and the Bump slot.
Finally
Attach the leaf canopy and the trunk into a single tree with a descriptive
name. Choose the default Match Material ID’s to Material option.
In
the Material Editor, activate an empty Sample Window and use the
eyedropper button to pick the material from the new tree object.
It will become a Multi/Sub-object material automatically.
The
tree is by no means finished; you must experiment with materials
to get the best illusion of leaves for your needs. Try experimenting
with Falloff maps in the Diffuse color slot and adjusting the Specular
highlights, for example, to create a more convincing look in your
scene. Right-clicking on the tree and going to Properties reveals
a total of 1330 faces for this tree, a very good start for a tree
that casts shadows and can be viewed from above.
Generic
Fir Tree
The
general principles used in creating a fir tree for use in your scenes
are similar to the deciduous trees, simple geometry and random materials.
The
trunk can be a simple cone with 5 sides, 1 height segment, and 20
feet high, for example. A single bough is a flat plane 4 feet in
length and 8 feet in width that has been converted to Editable mesh
and has the outer end corners welded to the end center vertices
to form 4 triangular faces. The center vertices have been moved
toward the outer end. See Figure 11.

Figure 11: Start with a Plane 4 feet by 8 feet, convert to Editable
Mesh and use Target weld to weld the outer end corners to the end
center vertices. Move the center 3 vertices to about 2/3 of the
way to the end of the plane.
Use
the Align tool to align the left center of the plane with the right
center of the trunk.
Go
to Hierarchy panel, Affect Pivot Only, and use the Align tool to
align the Pivot of the bough to the center of the base of the trunk.
See Figure 12.

Figure 12: Align the Plane to the center edge of the trunk and the
Planes Pivot to the center of the trunk base.
Raise
the 3 center vertices of the Plane similar to Figure 13. I used
2 ½ feet for the vertex close to the trunk and 1 foot for
the two outer vertices.

Figure 13: Raise the center vertices of the plane to create a bough
that “hangs” off the trunk and touches the ground.
In
the Top viewport, hold the Shift key and rotate the plane 36 degrees
in the Z-axis. Create 9 copies of the bough to surround the base
of the tree. See Figure 14. Use the Attach function to attach all
the planes into a single object and apply the leaf material from
the previous exercise. Assign the Trunk material to the trunk.

Figure 14: Rotate the plane 36 degrees in the Z-axis and make 9
copies. Attach all the planes into a single object.
With
the new bough object selected in the Top viewport, go to Tools,
Array. Enter 2’0” in the Z-axis Incremental Move field.
Enter 18 in the Z-axis Rotate field. Enter 80 in the X and Y Scale
and 90 in the Z Scale fields. The rest of the default are fine for
this example. See Figure 15.

Figure 15: Use the powerful Array tool to copy, rotate, and scale
in one action for a cone shaped array of boughs.
Attach
all the boughs and the trunk into a single tree and you have a reasonable
fir tree of only 420 faces. See Figure 16. You will, of course want
to adjust the materials for a more convincing coloration and bump
pattern, but this exercise should give you a start.
Figure
16: A deciduous tree with 1330 faces and a fir tree with 420 faces
can efficiently fill the background areas of your scene with foliage.
You could try applying a Noise modifier to the fir tree to randomize
it further.
Summary
Again, the sole purpose of this column is to get you started on
creating trees that can be used as filler in a scene. The advantages
are that they are very low polygon, they cast shadows, and can be
viewed from above. The disadvantage is that they look like crap
when viewed close up.
Adjusting
the materials will give you a wide variety of looks and, with a
little practice you can create new trees in a matter of minutes.
Try creating hedges and shrubs with this same technique, just leave
out the trunks.
These
trees can be mixed in a scene with other, more complex trees, again
as filler to make a fuller forest landscape.
Use
the Scatter tool to randomly place these trees over a landscape
surface, as well. The Proxy option of Scatter will allow you to
have complex forests that are fast in the viewports as they show
as simple pyramids and only as trees at render time.
The
leaves of the deciduous tree could be mapped with a leaf image with
opacity, but my experiments have shown this not to be cost effective
as the time required to calculate multiple levels of opacity can
be slow and the look is just not much better. Go for one of the
commercial third party options if these simple trees don’t
meet you needs.
Good
luck and have fun.
Ted
|