There are several different ways to make trees in a 3D package: starting from the simpler low-poly objects, such as the billboards used in video games (simple planes mapped with tree images on a transparent background), to middle complex objects where a trunk mesh is attached to a foliage mass made of little alpha textured planes, each one representing a leaf or even a twig, to more complex and heavy meshes, where every little branch and leaf is actually modeled.
In case you need them, you can find several free tree models in the Blender format and also their billboard versions at http://yorik.uncreated.net/greenhouse.html.
For this two-part tree shader recipe, we will instead use a model coming from the many environment assets of the CG short Big Buck Bunny, the second open movie produced by the Blender Foundation. All the movie assets are free to be downloaded, distributed, and reused even for commercial projects because the short is licensed under the Creative Commons Attribution 3.0 license (refer to its official website at http://creativecommons.org/licenses/by/3.0/).
The general shape of the tree and the leaves is pretty toyish. This is because they are elements that have been drawn to match the toon style of the furry characters, but it's actually perfectly suited for our demonstration purposes. The final rendered tree from Big Buck Bunny is shown in the following screenshot for your reference:
The tree model is composed of several parts: on the first layer, there are the tree_trunk, the tree_branch, and the tree_branches meshes, and on the second layer are the leaves, made by a single leaf object dupliverted on the tiny faces of the leaves_dupli object. (That is, the leaf_tobeswitched object is parented to the leaves_dupli object, and then, in the Object window and under the Duplication subpanel, the Faces duplication method has been selected, the Scale item checked, and the Inherit Scale value set to 1110.000
. This way, the leaf_tobeswitched object is instanced on the leaves_dupli object's many faces according to their location, rotation, and scale.)
On the 11th layer, there are three leaf objects with three different levels of detail: a simple flat Plane, a subdivided and curved Plane, and a modeled leaf. Their presence is only to supply the low, middle, and high resolution mesh data. By selecting the leaf_tobeswitched object and by going to the Object data window, it is possible to switch between the leaf_generic_low, leaf_generic_mid, and leaf_generic_hi foliage levels of detail.
In the first part of this two-part recipe, we will create the material for the bark, as shown in the following screenshot:
Start Blender and open the 9931OS_08_tree_start.blend
file. For this recipe, deactivate the second layer, and in Outliner, select the tree_trunk object.
Let's start by creating the bark material using the following steps:
bark
.Mix Shader_bark1
. In the first Shader slot, select a Diffuse BSDF shader node, and in the second one, select a Glossy BSDF shader node; then, label them as Diffuse_bark1
and Glossy_bark1
. Set the Glossy_bark distribution to Beckmann, the Roughness value to 0.800
, and the Mix Shader_bark1 node's Fac value to 0.200
.Mapping1
and Bark_color1
.textures
folder, and load the bark_color_tile.png
image.Bark_normal1
, and connect the Mapping1 node output to its Vector input socket. Make the image datablock single-user by clicking on 2, which appears on the right side of the image name. Click on the Open Image button (the one with the folder icon), browse again to the textures
folder, and load the bark_norm_tile.png
image. Set Color Space to Non-Color Data.Normal Map1
, and connect the Color output of the Bark_normal1 node to the Color input socket of the Normal Map1 node, and then set the Strength value to 2.000
. Click on the UV Map for tangent space maps button upwards of the Strength one and select UVMap (the trunk mesh has two different sets of UV coordinates, which we'll see later).0.350
for all three axes.Mix Shader_bark3
, and paste it right before the Material Output node. Connect the output of the Mix Shader_bark2 node to the second Shader input socket of the Mix Shader_bark3 node.15.000
, as shown in the following screenshot:At this point, if you look carefully at the Rendered view of the tree trunk, you'll see that sadly, there are ugly seams where the trunk's main body joins the big low branches as shown in the following screenshot:
This is due to the fact that the unwrap of the mesh has separated the branches' UV islands from the main trunk ones. Although the effect can be barely visible, let's say that you absolutely want to avoid this; that's why we are now going to see a solution for the problem, by using a second set of UV coordinates and a Vertex Color layer.
This is what we are going to do:
Join_branches
.UVMap2
. Place the mouse cursor on the 3D viewport, press U, and select Unwrap in the UV Mapping pop-up menu, as shown in the following screenshot:bark_seamless
.Now, by looking at the following screenshot, it is clear what we have to do:
As you can see in the preceding screenshot, there are no more visible seams; the two differently UV mapped materials smoothly blend together.
3.137.178.122