Note: This tutorial pertains to the old Yafray. For good documentation of the Yafaray Renderer, you may want to download Yafaray-Blender PDF Ebook.
For this tutorial, you will need to know how to use Blender 3D, a 3D modeling, rendering and animation software. If you are unfamiliar with the basics of Blender 3D, click here for introductory resources on this software.
Yafray is a free high quality raytracer. It is capable of producing photo-realistic renderings. For rendering of product and industrial design concepts, it is quite good for churning out photo-real outputs. The principle of product rendering is somewhat similar to that of product photography.
I use Yafray via Blender 3D. Installation of Yafray is quite straightforward. Simply download it from its main site at yafray.org and run the installation file.
To follow this tutorial, you will need to have Blender 3D installed on your computer as well.
With Yafray, lighting a scene is as per Global Illumination styled. Unlike non-GI enabled raytracers, lighting may not necessarily come from light sources such as spotlights, sun lights. Instead, the lightsource can come from the surrounding and light-emitting objects within the scene. That means, with Yafray, you need not add conventional light sources (such as spot light) into the scene.
This article describes the usual method of how I go about creating a Product Rendering using Yafray as the rendering engine.
Specifying objects as light sources
You can use objects as light sources. I usually use Mesh planes as light emitters. To make the object emit light, in the Material Panel, give Emit a value greater than zero. Note: when using Yafray, Blender’s area light is regarded as a light emitter instead of it being a conventional light type.
The higher the emit value, the brighter the light source. You can also change the colour of the light by changing the Col value of the object. Typically, I keep it white or grey.
Adding an Environment Map
Typically, I will add an Image as an environment map. The purpose of doing this is to create reflections on reflective surfaces. This will create more added details and interests to the rendering. I often use Jpeg as the image map. However, you can also use a Hdr file. To add the image into the World, go to the Texture Panel. Select World. Select Image from the Texture Type panel. Next, browse to the location of the Jpeg image. For a better picture, see the screenshot below.
Now, we need to ensure that the Image is appearing in the world. Go to the World Panel. Click the four buttons Blend, Hori, ZenUp and Zendown from the Map To section. This will enable the map to be seen on the Preview window.
If you are using Hdri light probe files, please select AngMap (Angular Map) from the Texture and Input panel. Under the Preview section, select Real. Under Map To, select Hori. Hdr files are High Dynamic Range image files that are capable of helping in creating very realistic reflections. To get free HDR maps, click here.
Rendering the scene
To render the scene, we will need to go to the Render Panel. Make sure Shadow, Ray, EnvMap are enabled. Under the big Render button, select Yafray as the Rendering Engine.
Now, we need to specify the settings for Yafray. Go to the Vafray GI panel. Under Method, select either Full or Skydome. Specify the Quality of the render.
Where necessary change the value of the EmitPwr. This value controls the intensity (brightness) of the light source emitters. Where necessary change the value of the GI Pwr. This controls the energy intensity of the emitter. To brighten or darken the scene, the easiest way is to tweak the GI Pwr value. Cache on will speed up the rendering process.
Some Rendering Results
Rendering 1 (directly below) is a Yafray rendering that uses the following setting:
- a mesh plane as an emitter
- a jpeg image as an environmental map
Rendering 2 (shown directly below) employed the following configuration:
- a mesh plane as a light emitter
- a Hdri image file as an environment map
As mentioned earlier, Yafray rendering may not necessarily include any light elements. Rendering 3 (below) is done without adding any preassigned light sources and light emitting objects.
As you can see, the first 2 renderings which have the added light emitter produced better contrasts. Also, the Hdri enabled rendering (Rendering 2) has more tonal variation and details than Rendering 1 which used Jpeg as an environmental map.
For added realism, you may also want to consider creating a Depth of Field (DOF) for the rendering. This will allow the important portion of the rendering to stay in focus, while the rest are more of less defocussed.
That’s the end of this tutorial on using Yafray for Product Rendering. I hope that it has been useful. 🙂