When dealing with foliage and trees, we usually tend to apply a single texture on the leaves, regardless of which side the leaves have.
In this brief tutorial/article, I'll introduce you to a basic concept in Cycles that enables you to utilize multiple textures so your planes will have a fronttexture and a back texture, perfect for use on leaves.
By the end of this tutorial, you should have a basic understanding on how to manipulate image textures using a variety of node techniques and hopefully to clear some confusion that you might have had.
To start off, enable the Import Images as Planes addon. This will make our lives a lot easier. However, you can skip this step if you want to manually apply your textures instead.
2 Import the Texture as Plane
In the 3D Viewport, press SHIFT-A and select Mesh > Images as Planes.
3 Browse Texture
A dialog window will appear asking you for the location of your texture. When you have it, make sure that Use Alpha option is enabled in the addon settings.
4 Adjusting the Image Ratio
Now, when you render your scene, it doesn't look like what we actually wanted. But it's a start.
Proceed to the Object Data tab and under UV Maps, create a front UV map and a back UV map.
Split your screen and make the other half a UV/Image Editor. Then browse for the texture you've downloaded.
Adjust your UV map (make sure that you have the front UV map selected) such that the it covers only the front portion of the texture, setting aside the back texture.
Select the back UV map and repeat the procedure above. By this time, it will be a matter of approximating the size and matching the front and back UVs accordingly. Do the necessary adjustment later as needed.
In the 3D Viewport, select the Plane object and adjust its scale so it matches the size ratio of the leaf.
5 Setting Up the Node Group
Now the fun part! Proceed to the Node Editor and you should see something like this for the material node:
Add a UV Map input and attach it to the Vector input of the Image Texture.
Duplicate the previous node configuration but this time change the UV map to back.
6 Combining the Front and Back Textures
This step is the most-crucial of all, don't skip this one.
Now that we have the front and back node layout in place, it's time to combine them. To do this, simply add another Mix Shader and connect the Shader output sockets into the input socket, as seen below:
To tell Cycles which side is which texture, we need to add some geometry information, and there's a handy node for that.
Go to Add > Input > Geometry, then connect the Backfacing node output to the Mix Shader's Fac input.
Now, when you rotate the plane, the back texture will show. No need for duplicate meshes. :)
I hope you learned a thing or two. If you like this article, spread the word, leave me a comment, and share it with your friends (if I deserve it).
And if you fancy, you can visit me on the following links: