Make a bunch of linked duplicates of the leaf.Scatter them along the Y axis.

Create a cube. (Spacebar > Add > Mesh > Cube)Rename the cube object to "twig", switch to edit mode and stretch/scale it to fit the leaves.Switch back to object mode.

Select the twig and all the leaves.Add them to a new group. (Object > Group > Add to New Group)In the "Object and Links" panel, change the group name to "twig".

Switch to layer 3.Duplicate the twig group. (Spacebar > Add > Group > twig)Move/rotate it.Add more until you have a good branch.Select every other twig and move them to layer 4.

Create a cube.Rename the cube object to "branch" and stretch/scale it to form the main branchThis is going to be shared by both branch planes, so you shouldn't make the twig to branch connections with this object.Make a linked duplicate and move it to layer 4.

Create a cube. Use this mesh to connect the main branch to the bases of the twigs.Switch to layer 4 and do the same thing for the other half of the branch.

Switch to layer 3.Rotate everything around the Y axis by -25 degrees.Switch to layer 4 and rotate everything around the Y axis by +25 degrees.

Shift+click layers 3 and 4 so they are both visible.Select everything.Add it to a new group. (Object > Group > Add to New Group)In the "Object and Links" panel, change the group name to "branch".

Switch to layer 5.Add an cylinder and make a tree limb out of it.Duplicate the branch group. (Spacebar > Add > Group > branch)Move/rotate it.Add more until you have a good tree limb.Select everything.Add it to a new group. (Object > Group > Add to New Group)In the "Object and Links" panel, change the group name to "limb".

Switch to layer 6.Add an cylinder and make the trunk out of it.Add the limbs and move/rotate them into position. (Spacebar > Add > Group > branch)If things get too slow, try changing draw type to "Bounding Box".If it's still too slow, go to layer 5 and remove the branches from their group. (Object > Group > Remove from All Groups)You should now have a tree that uses a few million faces.

=== Adding the Low Detail Planes ===

Switch to layer 13.Create a 2 sided plane.Switch back to object mode, and make layer 3 visible. (Shift+click)Switch back to edit mode.Rotate the plane around the Y axis by -25.Resize it so it fits the branch on layer 3.Repeat in layer 14 for the branch on layer 4.

Switch to layer 16.Create a 1 sided plane and fit it to the complete tree on layer 6.

UV unwrap everything but the leaf.

=== Setting Up the Materials ===

Switch to layer 1 and select the leaf.Select the shading panel.Change the color to green.

Switch to layer 2 and select the twig.Add a new material, name it "textured".Under "Links and Pipeline", enable "ZTransp".Under "Material", enable "Shadeless".Set the color to black (col, spec and mir), alpha to 0.

Add another texture, call it "x".In the textures panel, set the texture type to "Blend".Under "Map Input", choose "Nor".Disable the y and z inputs.Under "Map To", choose "Color" and "Neg".Set the color to red.Set the texture blending mode to "Add".

Add another texture, call it "y".In the textures panel, set the texture type to "Blend".Under "Map Input", choose "Nor".Set the x input to y.Disable the x and z inputs.Under "Map To", choose "Color" and "Neg".Set the color to green.Set the texture blending mode to "Add".

Add another texture, call it "z".In the textures panel, set the texture type to "Blend".Under "Map Input", choose "Nor".Set the x input to z.Disable the x and y inputs.Under "Map To", choose "Color".Set the color to blue.Set the texture blending mode to "Add".

Now assign that material to all objects except the leaf and the duplicated objects/groups.

You now have all the required objects and materials set up.

=== Converting the Branches to Planes ===Switch to layer 13.Select the branch plane choose "Object > Group > Add to Existing Group > branch".Do the the same in layer 14.Switch to layer 3, select all and then "Object > Group > Remove from All Groups".If you go to layer 6 the tree should now have planes instead of branches.

=== Setting Up the Camera ===Switch to layer 1.Select the camera and move it to layer 6 and then switch to layer 6.In the Scene/Format panel, set SizeX and SizeY to fit the billboard area in your texture.Set the format to PNG and RGBA.In the Editing/Camera panel, set the camera to Orthographic mode.Set the scale to the height of the billboard plane.Bring up the tranform properties window. (Object > Transform Properties)Set LocX to 0.Set LocY to -30.Set LocZ to 1/2 the height of your billboard plane.Set RotX to 90.Set RotY to 0.Set RotZ to 0.If you did it right, the dotted line that shows the camera border should match the billboard plane.

This is a good time to save.The next steps are either destructive or create extra junk you don't want saved.

Switch to edit mode, select all faces and switch to your color texture in the UV/Image Editor.Switch to the materials panel and uncheck the x, y and z textures.

Switch to the render panel.Under the Bake tab -Set the bake type to "Textures".Enable "Selected to Active".Set "Bias" to 10.Disable "Clear".Now click "Bake" and it should bake the textures for those branch planes.Repeat the process in layers 4/14.

While in edit mode, select all faces and switch to your normals texture in the UV/Image Editor.In the Bake tab -Set the bake type to "Normals".Set the normal space to "Tangent".Click "Bake" and it should bake the normals.Repeat the process for the other branch plane.

=== Fixing Up the Normals ===

If you like, you can now use a paint program to extend the edges of the normal map into the transparent areas of the map. This will keep the flat background from bleeding into the leaves in lower detail mipmaps, which will flatten out the shading.

=== Rendering the Tree Billboard ===In the Scene/Render panel, make sure "Key" is on.Click the render button to render the color texture.Save the rendered image.In the "textured" material, check the X, Y and Z textures.Select the "colormap" texture and under "Map To", deselect "Col".Click the render button to render the normals texture.Save the rendered image.

Copy the billboard renders into your textures.

=== Exporting the Models ===We've been working with the Z axis as the up vector instead of the Yaxis like MX Sim uses, so you'll need to rotate 90 degrees around theX axis before you export.Export tree billboard like any other model.For the full detail tree, select everything and make the duplicates real. (Object > Clear/Apply > Make Duplicates Real)Deselect all and then select the empty objects. (Select > Select All by Type > Empty)Delete the empty objects. (Object > Delete)Now select the tree limbs and trunk, with the trunk as the active object.Join the objects. (Object > Join Objects)The tree is now ready to export.

=== Smoothing the LOD Transistion ===To reduce popping you might want to make some extra LOD's to smooth out the billboard to 3d transition.If your tree is named "tree.jm" and the billboard "tree_lod8.jm",you want some LOD's just under 8 that progressively have their Z coords flattened out, but keep the original normal values.To do that, you can use this one liner in a Linux shell, or you could use a spreadsheet to do it.

A couple of things you might want to try now:- Make the tree go to planes at the twig level instead of the branch level. This will look better but use a lot of extra geometry.- Use more than one material for the leaves to vary the color more.

I'm glad someone finally used the longest tutorial ever! It looks like you did a nice job of mixing up the branch orientations. In the tutorial tree I didn't mix it up enough in the upper branches and wound up having the low detail normal map be dominated by one color there.

Josh VanderhoofSole Proprietorjlv@mxsimulator.comIf you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.

Just a note to anyone who does this in Blender 2.6. Turn 'Color Management' off under Shading in the Render menu. Makes everything too bright, which screws up the normal map. Took me ages to figure out what was causing that problem

Well I solved that problem. It was so simple too. I just did a border select of all the visible faces from the camera angle, then hid the faces that weren't selected. Now the normal map actually matches up with the model better

If you like, you can now use a paint program to extend the edges of the normal map into the transparent areas of the map. This will keep the flat background from bleeding into the leaves in lower detail mipmaps, which will flatten out the shading.

How did you do this step? I can't seem to figure out a way to expand the last layer of pixels outward.

TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.