Yafray as an Integrated External Renderer

Relevant to Blender v2.34

by Gaurav Nawani

Part 1

Yafray integration is one of the best features added to Blender. The current release of Blender 2.35 has a very neat integration with Yafray from within Blender, and is fairly stable to use. Unfortunately, Yafray usage is limited to those who are already comfortable with the Blender interface or can hack their way through. The first part of the tutorial deals with the basic steps needed to render from Yafray and later parts serve as a guide for the rest of the Yafray's available features.

Interface

Blender has two of its own rendering engines built-in and that includes it's own raytracer and an older scan-line rendering engine. Yafray however is a standalone raytracer. Its functionality is accessed through Blender's interface by exporting the scene parameters to a Yafray readable format by one of two options. For the first one Blender has the required support built-in which allows Blender to use Yafray as a plug-in, virtually as if Yafray were an inbuilt renderer, and the other option is where Blender exports the scene data to Yafray format in an XML file called YBtest.xml, and then Yafray renders it as a standalone program. Both methods require Yafray to be first installed on the system and it is assumed that you have both Blender 2.34 and Yafray 0.07 installed on your system.

The Yafray integration in Blender can be broadly categorized in two parts. One relates to the interface for light or lamp settings. The other one to the core Yafray rendering features.

Step-1

It is to be noted that this step might not be necessary for Windows. Before we proceed, we first need to configure Yafray preferences. Drag down the top menu bar to un-hide Blender's User Preferences window. Here click on File Paths button to open up the Path preferences menu. On the top left part is the YFexport text entry box. Enter the path where you would like to save the exported blend file in Yafray format (XML file) while rendering with the second option. This is necessary if you want to save the exported file and later edit it manually.

Figure 1. Path selection in User Preferences menu.

Step-2

As you are now aware, Blender allows you to choose between its own internal ray-tracer and Yafray. To use Yafray you first have to instruct Blender. To do that press F10 for Rendering Options window, now go to the Render tab in the Render Options window (Figure 2). In the Render tab, select Yafray from the Render engine drop down list (Figure 3), by default Blender internal is selected.

Note

Please do not get confused with the Ray button. This has nothing to do with enabling Yafray's ray-tracing. It does not effect in any way the Yafray renderings if Yafray is chosen as the raytracer from the rendering engine drop down list.

Figure 2. The default options in Render Tab.

Notice as soon as you choose Yafray two more tabs appear beside the Render tab (Figure 3). These two extra tabs are Yafray and Yafray GI and these two tabs have rendering and other features and parameters of Yafray.

Figure 3. Yafray raytracer selection and its two sub-tabs.

Now select the Yafray tab from the two new tabs, there will be some functions visible, right now we are interested in the button named XML (pressed by default) (Figure 4). You go ahead and turn it off right now. I will explain why, as I had told earlier that Blender has two options for rendering with Yafray, either as plug-in interface or to call Yafray as command line program.

Figure 4. Default Yafray tab with Yafray file export enabled. (XML button).

Figure 5. Disabled Yafray export.

Choosing the plug-in or first option (XML button off) allows you to see the rendering progress in the Render window (Figure 6), much like the Blender's own rendering, and this is one of the reasons why Yafray requires and uses more memory than before. Using the second option which is by default (XML button pressed) active, will first export the active scene to the YFexport path, which you have set in your File Paths preferences (the Section called Step-1). The Yafray is then called as a command line program, and it takes over the processing of the exported XML file, and only after completion provides the image back to the Render window, so there is no other interaction in between, save for the textual output in the Blender's terminal window.

Figure 6. The rendering in progress for Yafray XML disabled.

Step-3

After going through the first two steps you have virtually done every thing to make a Yafray render. At this time you have your scene ready with lamps of your choice, the best thing to proceed from here is to press F12 to render. Here is where the problem crops up for almost everyone. I will explain... Depending on the light settings in your scene, you either will see a blank screen or will see very faint outlines of the objects in the scene. Or if your lamps have higher light intensity (value) then you might see the scene properly. Alternatively, in extreme case, Yafray and Blender do a crash thingy.

In case you came up with black render the chances are good that you can render through Yafray, all you need now is to adjust the light's parameters, and you will have your own Yafray render within minutes.

Points to check for problems

  • The first problem for Yafray renders is almost every time a lack of sufficient light intensity in the scene. This is not actually a problem of Yafray, but an implementation issue from within Blender. So, in this case, you need to increase the light intensity, or value, of every lamp in the scene (more information in the Section called Part 2).

  • If every thing fails you might need to check for the distance value of the lamps, since the light attenuation falloff is mostly sharper in CG (to reduce computations), your objects in the scene might appear black because their ray casting distance just might not be reaching the objects in the scene. You can get around this by adjusting distance value in the Lamps tab.

  • In case of crash please check the elysiun forums for possible answers.