How to render alpha maps in Blender 3D and YafaRay for architecture
In one of the articles of the blog I have written about the setup of alpha maps in LuxRender, to render trees and other elements that could be created and rendered with textures, especially vegetation for external architectural visualization. Since then, a lot of people ask me about the same technique applied to YafaRay. Is that possible? Of course it is! But, the workflow to get the same results with 2d cutout trees or people is different in YafaRay. If you don’t remember, in LuxRender we have to use a null material type and there is no support for alpha maps in PNG files.
Since YafaRay can read most of the parameters and options from the Blender textures, those types of things won’t be a problem. In fact, the workflow to add alpha maps in YafaRay is very similar to what we do with the Blender internal render.
Let’s see how it works.
First of all, I have prepared a PNG file with a cutout tree taken from this free texture library. The Image was edited in GIMP.
Create a mesh plane or other object where the texture will be applied, and add a material and then assign an image based texture. At the image texture setup panel, we have only to turn on the Use Alpha button.
Go to the materials panel of Blender, and at the Map Input check the UV button and at the Mat To menu, press the Alpha button to make the texture affect the transparency of the object.
Open a UV/Image Editor window and Unwrap the plane. Open the texture in the editor to adjust the placement of the texture. A nice shortcut here is the ALT+V, which will fit the size of the plane to the proportions of the texture.
Now, open the YafaRay exporter panel and go to the material tab. Choose a shinydiffusemat and the only thing we will have to do here is set the transparency to 1. If you press the “Refresh Preview” button it will already show the result of the alpha map applied to the material.
With everything set, we can render the scene. If you have a 3d model or object, place the planes with the textures in key positions and render an image. In the example below I have the model created for the getting started with YafaRay for external render article.
This types of textures are quite handy for external architectural visualization.