You are on page 1of 83

3D Rendering with Yafaray for Blender

3D visualisation with Yafaray for Blender


1st Edition

A Blender-Yafaray User

Copyright Career Idea Site

3D Rendering with Yafaray for Blender Disclaimer of Liability. The ebook attempts to be as accurate as possible. However, the Author does not warrant that the content is entirely accurate, complete, reliable, current or error-free. You assume full responsibility for all of the information contained within this PDF ebook. We cannot be held liable in any way for results stemming from the practical use of this information. Under no circumstances shall the Author be liable for damages of any kind arising from the use of this ebook, including, but not limited to, direct, indirect, special, consequential or punitive damages or lost profits.

Contents
INTRODUCTION....................................................................................................................................1 CHAPTER 1 Blender Yafaray Interface ...........................................................................................1 General Overview of 3D Creation workflow.......................................................................................1 What is Yafaray..................................................................................................................................2 Pre-requisite.......................................................................................................................................2 Accessing Yafaray..............................................................................................................................3 CHAPTER 2 Yafaray Material ...........................................................................................................4 Overview of this chapter ....................................................................................................................4 Introduction to Yafaray Material..........................................................................................................5 Reflectance model.............................................................................................................................6 Material Types and Parameters.........................................................................................................7 Glossy Material..................................................................................................................................7 Coated Glossy Material......................................................................................................................8 Shiny Diffuse Material........................................................................................................................9 Glass Material....................................................................................................................................11 Rough Glass Material.........................................................................................................................12 Blend Material....................................................................................................................................13 Example of material application.........................................................................................................14 Creating a material library/database..................................................................................................15 CHAPTER 3 Surface Texturing ........................................................................................................17 Overview of this chapter.....................................................................................................................17 Texture Panel.....................................................................................................................................18 Adding Texture...................................................................................................................................18 Specifying Texture Type.....................................................................................................................19 Texture coordinates............................................................................................................................20 Mapping coordinates..........................................................................................................................20 Mapping Type.....................................................................................................................................21 Using Empty for texture coordinate....................................................................................................21 Influences...........................................................................................................................................22 Making Transparent decal effect........................................................................................................25 Texturing the Environment..................................................................................................................27 CHAPTER 4 UV unwrap and texturing ...........................................................................................28 Overview of this chapter.....................................................................................................................28 What is UV mapping..........................................................................................................................29 The UV mapping process...................................................................................................................29

Copyright Career Idea Site

3D Rendering with Yafaray for Blender

CHAPTER 5 Lighting ........................................................................................................................37 Overview of this chapter.....................................................................................................................37 Lamp..................................................................................................................................................38 Sun Light............................................................................................................................................38 IES Light............................................................................................................................................38 Area Light...........................................................................................................................................39 Spot Light...........................................................................................................................................40 Point Light..........................................................................................................................................40 Mesh Light..........................................................................................................................................41 CHAPTER 6 Environment Setting ...................................................................................................42 Overview of this chapter.....................................................................................................................42 Background setting............................................................................................................................45 Single color system............................................................................................................................45 Texture system...................................................................................................................................47 Gradient system.................................................................................................................................48 Sun sky1 system................................................................................................................................49 Skylight..............................................................................................................................................51 Sun sky 2 system...............................................................................................................................51 Volumetric..........................................................................................................................................52 CHAPTER 7 Rendering Settings .....................................................................................................53 Overview of this chapter ....................................................................................................................53 Rendering Settings.............................................................................................................................54 Render Lighting Modes......................................................................................................................55 Faking Global Illumination (ambient occlusion)..................................................................................57 Camera Effects Settings.....................................................................................................................58 Depth of Field.....................................................................................................................................60 Saving rendered image......................................................................................................................62 File formats........................................................................................................................................63 Tone Mapping.....................................................................................................................................64 Yafaray Settings for good renders......................................................................................................65 Working with Blender's Node Compositor..........................................................................................66 CHAPTER 8 Creating Flora for 3D Scenes .....................................................................................67 Overview of this chapter ....................................................................................................................67 Creating grass patch .........................................................................................................................68 Creating plants and trees ..................................................................................................................72

Copyright Career Idea Site

3D Rendering with Yafaray for Blender

CHAPTER 1

THE BLENDER- YAFARAY INTERFACE


General Overview Yafaray extends Blender's capability by providing Global Illumination capabilities. This often results in more realistic renders as compared to the default Internal Renderer. This courseware requires you to have prior knowledge of Blender 3D. It is meant to be a no-frill book aimed at rapidly bringing the user to a working proficiency in creating 3D images using the free and powerful Yafaray Renderer.

Copyright Career Idea Site

3D Rendering with Yafaray for Blender

What is Yafaray
Yafaray is an open source rendering engine that can produce high quality results. This rendering engine can take advantage of multi-core/thread to speed up rendering processes. Yafaray is a rendering program that can support 3D applications as an external rendering engine. Besides Blender, Yafaray also have export plugins to other 3D applications including Truespace and Softimage XSI. Pre-requisites To be able to follow the book, you will first need to have basic proficiency of Blender 3D. Where to get Yafaray Versions of Blender with Yafaray compiled can be obtained from Graphicall.org. Excellent versions are by Megasoft, which they can be downloaded from http://www.graphicall.org/megasoft78 Accessing Yafaray If you have a build of Blender with Yafaray installed, Yafaray's functionality can be accessed by selecting it at the Render option (as shown below)

Once the Yafaray Render option is selected, parts of Blender User Interface will change to reflect integration with this render engine.

Copyright Career Idea Site

3D Rendering with Yafaray for Blender

When Yafaray is selected as the render, there are some notable differences in the various options from the default internal render. These changes are mainly reflected in the follow sections of the properties windows panel:
Render Panel : Use for setting rendering options for images and animation World Panel : Controls for scene background. Object Panel : Controls object info Materials Panel: For creating and editing object shaders and materials Textures Panel: How the objects surface looks.

Object Render World

Material Texture

Copyright Career Idea Site

3D Rendering with Yafaray for Blender

CHAPTER 2

YAFARAY MATERIALS
General Overview This chapter covers Yafaray Materials. Yafaray material system can be quite confusing at times. This chapter aims to make it easier to understand.

Copyright Career Idea Site

3D Rendering with Yafaray for Blender

Introduction to the Yafaray Material


The Yafaray material system is significantly different from that of Blender Internals. However, like the Blender Internal Renderer, the creation of materials is still accessed from the Materials and Texturing panel.

Yafaray consists of the following Material Types: Blend: used for blending two pre-created materials. Glass: For creating transparent objects with IOR (Index of refraction). Suitable for glass and water. Coated Glossy: For making objects with 2 layers of finishing of which the top layer is glossy. Suitable for materials such as car paint and lacquered surfaces. Glossy: Suitable for creating materials including plastics and polished material. Can be used to create materials with anisotropic reflections such as specific types of metal finishing. Shiny diffuse: This material has options such as emission and basic transparency. Because of emission option, it can be used to make objects with emissive properties. This include objects such as floresecnt tube and led screens. Suitable for making perfect chrome object.

Copyright Career Idea Site

3D Rendering with Yafaray for Blender

Reflectance Models For Shiny Diffuse, Glossy and Coated Glossy materials, there are 2 reflectance models to choose from, namely : 1. Lambert 2. Oren Nayer

Lambert can somewhat produce a 'CG' look. Oren Nayer, on the other hand, is better at simulating rough surfaces. It is more suitable for creating materials such as paper, dirt, cloth and sand. Lambert Oren-Nayer

In the subsequent pages, we will explore the various material types and their parameters.

Copyright Career Idea Site

3D Rendering with Yafaray for Blender

Material Types and their parameters


Glossy Material
Glossy material colour is influenced by Diffuse reflection and Specular reflection. Typically, when a objects is more diffuse, it will be proportionally less specular. Likewise a highly specular material will have very low diffuse value. Therefore the higher the Reflection strength of the specular reflection, less of the Diffuse colour will be displayed. This is as shown below.

The exponent determines the sharpness of the glossy specular reflection. The higher the value, the sharper the specular reflection will be. Exponent=1 Exponent= 10 Exponent = 100

Copyright Career Idea Site

3D Rendering with Yafaray for Blender

The Anisotropic option is for making reflections that are not equal in all directions. This shading option causes specular highlights to elongate.

Coated Glossy Material


This material is suitable for simulating car-paint and lacquered objects. Coated Glossy material has a reflective coating layer over the base layer. All other settings for Coated Glossy are as per the original Glossy material. The top reflective layer is the section labelled as Coated Layer for glossy. The Fresnel Effect was discivered by Jean Augustine Fresnel in 1834. Fresnel reflection is the phenomenon that the amount of reflectance you see on a surface depends on the viewing angle. IOR value controls the Fresnel Reflection intensity. The higher the IOR value, the more reflective at every angle.

Copyright Career Idea Site

3D Rendering with Yafaray for Blender

Shiny Diffuse Material


Shiny diffuse can be used to create materials without specular highlights. This includes high reflective surfaces such as chrome. For chrome and highly reflective material, give high specular reflection strength ( see below right)
Specular reflection strength =0 Specular reflection strength =0.9

As Shiny Diffuse includes an Emit option, it can be used to create self-illuminating objects. To do that, provide Emit value greater than zero (as shown below).

Fresnel reflection is the phenomenon that the amount of reflectance you see on a surface depends on the viewing angle. IOR value controls the Fresnel Reflection intensity. The higher the IOR value, the more reflective at every angle.

Copyright Career Idea Site

3D Rendering with Yafaray for Blender

Shiny diffuse material also have Transparent and Translucent parameter. Therefore it can also be used to create transparent and translucent objects without IOR (index of refraction).

Transparency and Translucency options: Transparency: define strength of transparency Translucency: define strength of translucency Transmit Filter: colour filter strength
Transparent = 0.7 Translucent = 0 Transparent = 0.0 Translucent = 0.9

Transparent = 0.1 Translucent = 0.9 Transmit Filter = 0.9

Copyright Career Idea Site

3D Rendering with Yafaray for Blender

Glass Material
Glass Material is ideal for making transparent objects with IOR (Index of refraction). This material is suitable for simulating glass, plastic and liquid. Yafaray glass is capable of producing caustic effects for added realism. Caustics are light patterns created on a surface by light which has passed through a transparent object or bounced off something curved. Real glass setting Options: Colour and absorption: defines the colour of the transparent object IOR: Index of refraction which is the value of a transparent material that describes the amount of refraction which takes place when light passes through it. Dispersion: causes white light to separate into different colours.

Fake glass setting Options: Filter colour: Defines the colour of the transparent object. Colour will be uniform and is not realistic for materials with varying thickness.

Copyright Career Idea Site

10

3D Rendering with Yafaray for Blender

Ray depth affects the realism of the glass render. Ray depth is set at the Render Panel (which will be discussed in Chapter 6). Higher value will brighten the interior of refractive transparent materials, creating better realism. Ray Depth= 3 Ray Depth= 15

Rough Glass Material


Rough glass material extends Original Glass material with a Roughness exponent.

Copyright Career Idea Site

11

3D Rendering with Yafaray for Blender

Blend Material
Blend material creates a new material by blending two pre-created materials.

The interface is fairly self-explanatory


Blender value: denotes the Blending ratio Material One: 1st material. Click the material icon (ball) to display drop down menu to select required material. Material Two: 2nd material. Click the material icon (ball) to display drop down menu.

Note: As of this writing, for materials using image maps, both the blending components must be present on the scene. If not, textures maps may not be displayed.

An example of Blend Material is shown below:

Material One

Material Two

Blend Result

Copyright Career Idea Site

12

3D Rendering with Yafaray for Blender

Example of material application


Rendering below show examples of material type applications.

Glossy

Shiny Diffuse Shiny diffuse

Coated Glossy

Copyright Career Idea Site

13

3D Rendering with Yafaray for Blender

Creating a material library / database


In Blender, a material library seems to be inexistent. However, this apparent limitation can be overcomed by the usage of Blender's append feature. In fact, this allows for flexibility in extracting material information from other Blender files. To extract material data from another Blender file.. 1. Go to file >> Append

2. Open the Blender file where the required material/s are contained. 3. In the Blend file, there is a section call Material. Click on it. 4. Next, selected the required material from the list (as shown below)

5. Next, go to the material panel.

Copyright Career Idea Site

14

3D Rendering with Yafaray for Blender

6. Click on the material stack. From the drop-down menu, the appended material will be listed here, of which you can select to assign it to the currently object.

Tips It is a good idea to create a commonly-shared blender file to be used as a material library. Materials can be named appropriated for easy identification when performing appending.

Copyright Career Idea Site

15

3D Rendering with Yafaray for Blender

CHAPTER 3
SURFACE TEXTURING
Overview of this chapter
In this chapter, we will expand on the understanding of material shader built upon from Chapter 2. Here, we will be exploring texturing of 3D object surfaces.

Copyright Career Idea Site

16

3D Rendering with Yafaray for Blender

Texture Panel The Texture panel allows you to create and manipulate texture properties for objects. The texture button works hand in hand with the material panel. Adding Texture Yafaray contains multiple types of textures. To add a new texture, 1. Select the object (Object mode) 2. Make sure that the Object already have basic material properties 3. Click Texture Button to access texture panel 4. Click New.

Texture button

Layer/ Channels Yafaray allows for multiple layers of texture in a single material. It should be noted that unlike typical image editors such as Photoshop or GIMP layers which stack upward, Yafaray texture layer system stacks downwards.

Copyright Career Idea Site

17

3D Rendering with Yafaray for Blender

Specifying texture type To specify a texture type, click the Type option display. To use external image as a map, select Image or movie

Yafaray comes with many texture types, most of which are procedural textures. Procedural Textures within Yafaray include: Cloud Voronoi Stucci Musgrave, etc

Cloud

Marble

Musgrave

Wood

Voronoi

Distorted Noise

Copyright Career Idea Site

18

3D Rendering with Yafaray for Blender

Texturing coordinates Texturing coordinates determines the type of coordinates used to place the texture on the surface of the object. Texturing coordinates and Projection types are specified under 'Mapping' section.

Mapping coordinates Blender comes in several coordinate systems. However, not all are supported by Yafaray. The ones supported include: Global Global Coordinate Object uses coordinates specific to an object UV UV mapping coordinates

Copyright Career Idea Site

19

3D Rendering with Yafaray for Blender

Projection Mapping type Yafaray sports several Mapping Types. This include:
Sphere Flat Tube Cube

Their mapping orientation are as illustrated below:

Sphere

Flat

Tube
Using Empty as Texturing Coordinates

Cube

Texturing coordinates of an Object can also be specified by an 'Empty' Object. To do that, for the Coordinate type, pick Object. Under the Object column, choose the Empty

Empty Object

The advantage of using an empty is that the map's position and orientation can be changed simply by transforming the empty's transformational value.

Copyright Career Idea Site

20

3D Rendering with Yafaray for Blender

Influences
This section determines the type of Influences that will be affecting the Texture. Influences determines how the selected texture affects the surface.

For example having 'bump' enabled (checked) will create a bumpy influence for the texture. It should be noted that Bump mapping produces no real depth or height changes to the surface.. The numerical value (0 1.00) controls the intensity of the influence. Below are examples of various influence on the same texture. Diffuse colour Bump

Copyright Career Idea Site

21

3D Rendering with Yafaray for Blender

Blend mode determines how texture channels blend with one another The blend mode is similar to the Layer blend mode in image editors such as Photoshop and GIMP. Yafaray blend modes include: Mix Add Subtract Multiply Screen Difference Divide Darken Lighten

It should be noted that unlike typical image editors such as Photoshop or GIMP layers which stack upward, Yafaray texture layer system stacks downwards. Some Blend options: No RGB : Converts the colour value of a texture to greyscale Negative: Inverts value of texture

Stencil: Use the current texture as the blending value on the next one. Colour : the default colour for textures that don't return RGB values.

Copyright Career Idea Site

22

3D Rendering with Yafaray for Blender

Different Material types support different Influences. Yafaray's Glossy and Coated Glossy materials support the following types of influences:
Diffuse Colour Glossy Colour Glossy amount Bump

Yafaray's Shiny Diffuse material supports the following types of influences:


Diffuse Colour Mirror Amount Mirror Colour Transparency Translucency Bump

Yafaray's Glass and Rough Glass material support the following types of influences:
Bump Mirror Colour

Copyright Career Idea Site

23

3D Rendering with Yafaray for Blender

Making Transparent Decal Effect The following steps describe the essential process for creating a decal on a 3D object. An example of a decal is as shown below.

To create transparent Decal, two maps have to be present: 1. A colour diffuse image map. This map determines the colour/RGB values for the texture. Map used to create the render above is as shown below.

2. A black and white image map to specify transparent regions. Map used to create the image above is as shown below.

The texturing sequence should be as below. That is, Colour map should be stacked above the Black-white map for alpha.

Copyright Career Idea Site

24

3D Rendering with Yafaray for Blender

Colour diffuse map settings are as shown on the right. The essential settings are
1. Under Yafaray Influence option, Diffuse Color must be enabled. 2. Yafaray Mapping (Map input) to set appropriate settings.

Black white image map settings are as shown on the right. The essential settings are
1. Under Image Sampling option, Calculate Alpha must be enabled. 2. Under Yafaray Influence option, Transparency must be enabled. This value should be set to -1.0 . 3. Yafaray Mapping (Map input) to set appropriate settings.

Copyright Career Idea Site

25

3D Rendering with Yafaray for Blender

Below is an example of using decal as leaves for the tree.

Texturing the Environment (World) Besides texturing objects, the Texture Panel can also be used to provide textures for the World scene/environment. To do that, go to the Texture Panel and click on the World Button as shown below.

More information on texturing the environment are in Chapter 6. Note Yafaray cannot work with packed textures. If you are transporting the file to another computer and will need to pack data, the data should be unpacked first before commencing rendering using Yafaray.

Copyright Career Idea Site

26

3D Rendering with Yafaray for Blender

CHAPTER 4
UV Unwrap and Mapping
Overview of this chapter
In this chapter, we will expand on the understanding of texturing built upon from Chapter 3. Here, we will be exploring UV mapping of 3D object surfaces.

Copyright Career Idea Site

27

3D Rendering with Yafaray for Blender

What is UV mapping UV mapping is a texture-mapping coordinate system designed for texturing complex surfaces that will otherwise be difficult to map using the typical mapping projection types.

The method for UV mapping using Yafaray is the same as that of using Blender's internal. For the purpose of clarity, the steps will nevertheless be illustrated in this chapter. The UV mapping general process The typical process of UV mapping entails the following steps: 1. 2. 3. Unwrap the 3D mesh model. Adjust UV Face Layout using UV/image editor Export the UV Face Layout as an Image Map

4. Using an external Image Editing Program, create the UV Map from the exported UV Face Layout 5. 6. Load newly-created UV Map into the UV-editor Loading UV map for rendering

Copyright Career Idea Site

28

3D Rendering with Yafaray for Blender

Step 1: Unwrap the 3D Mesh object For complex forms, some times it is a good idea to mark seams. This is to tell Blender the edges of the mesh to unfold from. To mark seams, in Edit Mode, go to Mesh>> Edges >> Mark Seam

Now, we need to open the UV/image editor. Click on the Windows Type Button, go to UV/Image Editor

Copyright Career Idea Site

29

3D Rendering with Yafaray for Blender

Go to Mesh >> UV Unwrap.

Choose the appropriate UV Calculation. For this case, use Unwrap. With the mesh fully selected in Edit Mode, the Mesh UV layout should appear in the UV/Image Editor

Copyright Career Idea Site

30

3D Rendering with Yafaray for Blender

Step 2: Adjust UV Face Layout using UV/image editor Sometimes, there is a need to improve the UV Layout. The vertices can be repositioned. To keep specific vertices in place, use Pin (P Key). Pinned vertices are red in colour.

Pinned Vertices

With strategically-placed pinned vertices, use Unwrap to re-calculate new layout.

Copyright Career Idea Site

31

3D Rendering with Yafaray for Blender

Step 3: Export the UV Face Layout as an Image Map To export the UV Face Layout, go to UVs >> Export UV Layout. For optimised output, size to be in powers of two such as 64, 128, 256, 512 or 1024. Save the image file format as a PNG image.

Step 4: Using an external Image Editing Program, create the UV Map from the exported UV Face Layout In an external Image Editing Program, create the UV-map using the UV Face Layout as a background template.

Copyright Career Idea Site

32

3D Rendering with Yafaray for Blender

Save the newly created UV-map as a JPG or PNG image file. Step 5: Load newly-created UV Map into the UV-editor In order for the UV-map to appear on the surface of the Mesh, we need to load it into the UV/Image Editor. In Blender's UV Image Editor, go to Image >> Open and load the create UV-map.

Change the Draw Type to Textured, the UV-map should appear on the 3D Mesh.

Copyright Career Idea Site

33

3D Rendering with Yafaray for Blender

Step 6: Loading UV map for rendering In order for the UV-map to appear in a 3D render, it must be properly loading unto the material of the object. Firstly, go to the Texture Panel of the object, click New. A new Tex column should be added as shown below.

Next, go to 'Type' section, select Image or Movie (as shown below)

Now, we need to load the UV-map. Go to Image >> Open. Browse and load the UVmap.

Copyright Career Idea Site

34

3D Rendering with Yafaray for Blender

Now, we need to set the correct coordinate type 1. Go to Mapping >> Coordinates 2. Select UV.

Below is the UV-mapped model as rendered using Yafaray.

Copyright Career Idea Site

35

3D Rendering with Yafaray for Blender

CHAPTER 5

Lighting
General Overview Light is an indispensable part of 3D rendering technology. Yafaray has its own lights that differs from Blender 's defaults. This chapter covers Yafaray Lighting.

Copyright Career Idea Site

36

3D Rendering with Yafaray for Blender

Lamps Yafaray consists of the following light types:


Point light Sun Light Spot Light IES light Area light

Sun Light Sun Light can work with the World>> Sun sky system. Angle: Determine the light cone angle. Larger angle results in softer shadow as distance increase from the sun. Samples: Controls noise level. Directional: Creates parallel light

IES Light IES lights are real light values supplied by light manufacturers. IES light can be used to provide accurate interior illumination. To input IES light data, click the Open browser icon to get the IES file.

Copyright Career Idea Site

37

3D Rendering with Yafaray for Blender

From the list of IES data, select the required one.

Area Light Area lights creates nice soft shadows. By default it is invisible. It can be made visible. To do that, tick Create Geometry

Higher sample values give better looking shadows but increases rendering time.
Copyright Career Idea Site

38

3D Rendering with Yafaray for Blender

Spot Light/lamp Spot light simulates a cone shaped light. It has a circular circumference. Click Soft shadow to enable soft shadow.

Track To constraints can be applied to Spot light for its direction to be targeted at a particular object. An easy way to apply a target is to use the hot key command. To do that, press and hold Shift key. Select the spot light followed by the target object. Press CTRL + T keys. Select Track to Constraint option. Point Light/lamp This is a general purpose omni directional point light source. In real life, point light is an unlikely and rare occurrence. By default Point light produces hard shadows. However, clicking Sphere opens up more options, enabling the possiblity of producing soft shadows. By adjusting Shadow soft size, Sphere light is able to create soft shadows.

Copyright Career Idea Site

39

3D Rendering with Yafaray for Blender

Mesh Light - 3D Objects as light source Objects can be used as light objects. To make a 3D mesh object a light source: 1. Select the object 2. go to the Properties >> Object Panel. 3. There is a section call Yafaray Object Properties. Click on Enable Meshlight

Mesh light casts light in the direction of its normal. Power determines the intensity/brightness of the light. Samples controls the smoothness of the light spread.

Copyright Career Idea Site

40

3D Rendering with Yafaray for Blender

CHAPTER 6

Environment setting
General Overview This chapter covers environment settings which are located mainly in the World Panel. Yafaray's environment settings can be used to create realistic backgrounds.

Copyright Career Idea Site

41

3D Rendering with Yafaray for Blender

Background setting Yafaray's environment setting is accessed at the World property panel. It consists of the following type of background: 1. Single colour 2. Sunsky 1 3. Sunsky 2 (formerly Darktide's Sunsky) 4. Texture 5. Gradient

Single Color System The Single color system create a background with a single uniform color.

Use IBL option: when this option is enabled, Yafaray uses the background as a source of illumination.

IBL sample: higher sample value produce better results

Copyright Career Idea Site

42

3D Rendering with Yafaray for Blender

Texture System
The texture system works similarly to Blender's default. It can be used to load LDR as well as HDR (High Dynamic Range) images as Background.

To start using Texture as a background, at the World panel: 1. Select Background >> Texture 2. Click 'New.

Now we will be presented to several options: Use IBL option: when this option is enabled, Yafaray uses the background as a source of illumination. When Use IBL is enabled, more options are displayed. They are: Caustic Photons: Allows caustics to be generated. Diffuse Photons: Allows background light to shoot diffuse photons IBL Samples: Number of samples for direct lighting from the background. Higher sample should produce better results.

Copyright Career Idea Site

43

3D Rendering with Yafaray for Blender

3. Next, we need to head to the Texture panel of the properties button (see screenshot on the right >>) . 4. Select Type >> Image or Movies 5. Under Map Image tab, click Open. 6. Select the required image.

7. Under Yafaray Mapping, select the appropriate Texture Coordinates Type.

Copyright Career Idea Site

44

3D Rendering with Yafaray for Blender

Note: Texture coordinate naming convention can be confusing for beginners. Angular Maps (AngMap) - are really ball-shaped maps. Many HDRI maps come in this format. An Angular map wraps around the scene in a dome manner. Example of angular maps are as shown below:

View- The default orientation, aligned with the co-ordinates of the final render Sphere- Sphere mapping, similar to that of materials texture mapping Tube- Wrap the rectangular texture around in a cylinder, similar to that of materials texture mapping

Gradient system
The Gradient system can create a graduated sky and ground background effect that can be quite realistic.
It consists of 4 parameters: 1. Zenith color 2. Horizon color 3. Horizon ground color 4. Zenith Ground color Use IBL option: when this option is enabled, Yafaray uses the background as a source of illumination.

Copyright Career Idea Site

45

3D Rendering with Yafaray for Blender

Sunsky 1 system
The Sun Sky system provides an useful environment for illumination utilizing the Sun. It can be used in conjunction with the Sun Lamp within Blender. Sunsky simulates the range of daylight atmospheric conditions

Get position: Takes sun position from a selected sun lamp in the 3D scene. Get angle: Takes sun angle from a selected sun lamp in the 3D scene. Update sun: Exports and update Sun position and angle to a selected sun according to input values.

Direction Sphere: Drag your mouse cursor over this sphere to interactively select the direction of the sun rays.

Add sun: A realistic Sun model is added to the scene, taking into account Sun position and power settings.

Copyright Career Idea Site

46

3D Rendering with Yafaray for Blender

Turbidity value influences the haziness of the atmosphere. The higher the value, the more yellowish the sky gets Turbidity = 1 Turbidity = 3

Turbidity = 6

Turbidity = 9

Copyright Career Idea Site

47

3D Rendering with Yafaray for Blender

Skylight When skylight is enabled, sun sky provides additional illumination for the scene.

No skylight

With Skylight

Sunsky 2 system
Sunsky 2 is a more complex version of the Sunsky 1 system. It was formerly known as Darktide's Sunsky. It extends Sunsky 1 with the options as shown below: Exposure: exposure correction. Zero denotes no correction Sky brightness: value for sky brightness Color space: select model for colour space

Copyright Career Idea Site

48

3D Rendering with Yafaray for Blender

Volumetric Effect
Volumetric Effect is a technique that allows glows or beams of light to shine through the environment. In order for volumetric to work, there are several required steps: 1. The Yafaray Volume Integrator must be enabled as Single Scatter. It is found in the Properties Window >> World Panel

2. A cube object must be used as the Volume Region. With the cube object selected, go to the Properties window >> Object Panel. In Yafaray Object Properties, Enable Volume (as shown below).

3. There must be at least one light source to illuminate the scene.

Copyright Career Idea Site

49

3D Rendering with Yafaray for Blender

Below example shows a meshlight object within a Cube with Volume enabled. Volumetric enable

Below example uses a spotlight within a Volume-enabled cube. This adds dramatic effect to the scene.

Copyright Career Idea Site

50

3D Rendering with Yafaray for Blender

Volume Integrator settings


These settings are at the World Panel Step Size: determine the volumetric rendering precision. Decreasing value increases the steps, therefore more accurate. Att Grid resolution: Lower value reduces details in shaded area. Typically value 2-3, more for darker scenes. Adaptive: optimises step calculation Optimise: speeds up process

Enable Volume setting


These settings are at the Object Panel. The volume region Cube must be selected in order to enable volume to it. Absorption: Controls how much of the light is absorbed. Higher value, lesser light shines through. Scatter: scattering affects how light traveling along a path encounters a particle in a volume. Higher value gives a denser look.

Scatter = 0.01

Scatter = 0.1

Copyright Career Idea Site

51

3D Rendering with Yafaray for Blender

CHAPTER 7

RENDERING SETTINGS
General Overview Yafaray extends Blender's capability by providing Global Illumination capabilities. This chapter covers Yafarays rendering modes and settings.

Copyright Career Idea Site

52

3D Rendering with Yafaray for Blender

Render Settings Rendering settings are largely at the Render Properties Panel This panel differs significantly from Blender Internal Render's. To render the current frame, click the Render > Image Button. To render the animation, click the Render > Animation Button. Tips: By default, the number of threads is set to 1. To maximise rendering speed, use the maximum amount of thread that your computer's processor can offer. This will greatly improve rendering speed. Multithreading allows multiple threads to exist within the context of a single process. These threads share the process' resources but are able to execute independently. General setting options
Ray Depth: Ray Depth determines the number of times a light ray can be reflected and/or refracted. Important for rendering transparent and reflective objects realistically. Ray depth is for the reflections, mirrors and glass and the bigger this number the slower the render Higher value provides better realism. Clay Render: produce rendering which looks like that of a clay model. Image on right is an example of a clay render

Copyright Career Idea Site

53

3D Rendering with Yafaray for Blender

Rendering Lighting modes There are different Lighting Methods within Yafaray. A good understanding is essential for controlling output result. To select the required lighting method, go to Yafaray Integrator >> Lighting Methods. Select the intended method from the drop-down list.

Direct Lighting versus Global Illumination When using modern renderers such as Yafaray, an understanding of the term Global Illumination is essential. What is Global Illumination? It is any of the various types of 3D rendering algorithm that take into account not only the light which comes directly from a light source (direct illumination). It also take into account light rays from the same source that are reflected by other surfaces in the scene, whether reflective or not (indirect illumination). Direct Lighting does not compute indirect illuminations in the 3D scene. It is fast but not as realistic as Global Illumination. Global Illumination gives added realism by taking into accounts effects such as light scattering and colour bleeding between adjacent surfaces.
Direct Lighting Global Illumination (Photon Mapping)

Copyright Career Idea Site

54

3D Rendering with Yafaray for Blender

The followings are different lighting method/rendering modes within Yafaray: Direct lighting. Direct lighting + AO provides a good alternative to full blown global illumination. AO stands for Ambient Occlusion. This method will not provide colour bleeding effect. This is the fastest rendering mode. Photon mapping + FG (A Global Illumination method). For enclosed and indoor settings, this option is suitable. This method is suitable for interior rendering. Photon mapping is a biased rendering method which means that averaging many renders using this method does not converge to a physically correct solution. FG stands for Final Gather. It calculates the diffuse irradiance from indirect lightings in the scene. Final Gather can help improve photon mapping quality. It does so by reducing the number of photons required Bidirectional path tracing (A Global Illumination method). . Suitable for 3D scenes where light sources can be seen from the camera. Use for suitable where accuracy of global illumination is required. Path tracing (A Global Illumination method). . For indoors scenes, path tracing is not as efficient as photon mapping. Path Tracing should be used in situation where light source can directly illuminate objects. Therefore it is more suitable for outdoor scene. It is suitable for use with large area light and emitters such as area light and meshlight. Path Tracing is an unbiased rendering method, therefore it can be quite slow.

Copyright Career Idea Site

55

3D Rendering with Yafaray for Blender

Faking Global Illuminations ( Ambient Occlusion)


Global illumination method such as path tracing can be slow to render. Yafaray provides a fake GI (Global Illumination) method in the form of Direct Lighting in combination with Ambient Occlusion (and/or Caustic photon). Ambient occlusion is a lighting technique used to provide 3D environments an effect as if they were lit from the entire hemisphere. This provides a faster method of rendering than true global illumination. However, ambient occlusion is unable to calculate colour bleed between adjacent surfaces. Direct Lighting only Direct Light + Ambient Occlusion

Direct Lighting Clay render

Clay render + Ambient Occlusion

Copyright Career Idea Site

56

3D Rendering with Yafaray for Blender

Camera Effects Settings With the Camera object highlighted, specific camera effects can be accessed at the Object Data Panel. The renders can have four different view modes. They are as shown below: Perspective mode This is the default mode.

Architect mode In this mode, vertical lines and edges in the scene do not converge. As the name implies, it is suited for certain type of architectural render.

Copyright Career Idea Site

57

3D Rendering with Yafaray for Blender

Angular mode This mode produces panoramic view. Angular mode creates images with exceptionally wide fields of view

Ortho mode This mode produces an orthographic projection-type view.

Focal Length Focal length option is self-explanatory In photography (and 3D), the focal length is indicative of the camera lens' optical length . Basically there are 3 main types of lens that are classified according to their focal lengths: 1. Normal lens- this range from 35mm to 85mm. It is close to how the human eye perceive things. 2. Wide-angle lens - basically any value below 35mm is considered as wideangled. This ranges from 14mm - 18mm (super wide angle) to 28mm-35mm (wide angle). Wide angle lens give greater field of vision than normal lens. 3. Telephoto lens -basically any value above 85mm is consider as telephoto. These lens allows one to capture scenes that are normally too far away.

Copyright Career Idea Site

58

3D Rendering with Yafaray for Blender

Depth of Field The Depth of field (DOF) is the distance between the nearest and farthest objects in a photographic or 3D rendered scene that appear acceptably sharp. The area within the depth of field will appear sharp, while the areas in front of and beyond the depth of field will appear blurry. The Depth of field settings are also at the the Camera's Object Data Panel

Options:
Aperture: Larger aperture value will produce blurrer images outside of the DOF. A smaller aperture gives a larger Depth of field, while a larger one produces a shallow DOF. DOF object: The object will be in focus. Use the dropdown menu to select the required object to be in focus. Bokeh Type: specify the shape of out-of-focus points

Copyright Career Idea Site

59

3D Rendering with Yafaray for Blender

Typically, to create a rendering with a Depth-of-field 1. Firstly, select the DOF object.

2. Set the Aperture. Below is example of render with different aperture value. As describe previously, larger aperture value will produce blurrer images outside of the DOF. Aperture = 0.02 Aperture = 0.2

3. Set Bokeh Type Bokeh is the blur in out-of-focus areas of an image. Yafaray bokeh type include, hexagon, ring, square, pentagon, triangle, disks.

Copyright Career Idea Site

60

3D Rendering with Yafaray for Blender

Saving Rendered Image The output setting section specify saving location and file format. By default, the rendered image will be saved in C:\tmp as an PNG file.

If under the General Setting, Render is set to Image File, the resultant render will be automatically save in the location defined by the Output Settings.

Anti-aliasing settings Aliasing are the jaggy edges and noise of rendered 3D objects. Anti-Aliasing settings helps reduce rendering noise and smoothens the way edges are being displayed. This is a fairly important section. Without good understanding and setting, it can be quite daunting to create noise-free renderings. Options:
Passes: define the number of passes/times that the process with run. Additional Samples: define the number of samples for additional passes. Threshold: define the color threshold for additonal samples in the next pass Sample: define the number of sample/s for the first pass. Pixelwidth: define the filter pixel size

Copyright Career Idea Site

61

3D Rendering with Yafaray for Blender

File Formats Yafaray renders can be saved as LDR (low dynamic range) as well as HDR (high dynamic range) images. LDR format includes: PNG JPEG BMP TIF

JPEG is a lossy compression method, which somewhat reduces the image fidelity. Lossy compression means that the image loses quality and information each time it is saved. As such, it should not be used in situations where the exact reproduction of the data is required. PNG, BMP and TIF, on the other hand, are lossless data compression format. PNG will tend to create smaller file sizes when compared to BMP and TIF.

HDR format include EXR HDR

The file extension for OpenEXR is *exr. It is a high dynamic range imaging image file format that was released as an open standard. It is advisable to save the final render as both LDR as well as HDR. HDR format such as EXR (openexr) allows for tone mapping which enables fine tuning of image exposure.

Copyright Career Idea Site

62

3D Rendering with Yafaray for Blender

Tone Mapping Tone mapping is a technique used in computer graphics to map one set of colors to another. The purpose is to approximate the appearance of high dynamic range images in a LDR (low dynamic range) format. In another words, the dynamic range of an HDR image is reduced to fit into a normal image (LDR). A free tone mapping software is Luminance HDR. It works with the EXR format that Yafaray can output. Below is a screenshot of Luminance HDR.

Before applying tone-mapping, Pre Tone mapping gamma adjustment should be taken in account. More of this will be discussed in chapter 8 (Scenario Examples). The value for pre-tone map is 1/ Yafaray Output Gamma. Yafaray Output Gamma 1.8 2.2 Pre tone mapping Gamma 0.5555 0.45

Luminance HDR is available on Linux, MAC & Windows. More information on Luminance HDR can be found at http://qtpfsgui.sourceforge.net/
Copyright Career Idea Site

63

3D Rendering with Yafaray for Blender

Yafaray Settings for good render For this section, we will focus on some Yafaray settings that aid in giving reasonable results. 1. At the Anti-aliasing setting section, lower AA Threshold, coupled with multiple passes help to clean up grains more thoroughly. AA Threshold with values approximately or lower than 0.005 allow a tight scanning area for the passes to clean up the noise. See screenshot below

2. For Photon Mapping, search radius appears to influence the intensity of image noise and white spots. Lower values tend to give nicer results. However, search radius takes into account the real scale of the scene. More of this will be discussed in chapter 8 (Scenario Examples). The ideal situation is to blend enough photos using a given search radius so that the result form a nice and realistic image. 3. If you do not need colour bleeding, Direct Lighting + Use AO can give nice and fast result without image noise and white spots issues. 4. For creating caustics, Photon Mapping is the easier option. Use a small light source such as an area light or mesh light to focus a caustic effect.

5. As a general rule, objects should also have wall thickness to prevent some of the problems with rendering artifact issues.
Copyright Career Idea Site

64

3D Rendering with Yafaray for Blender

Working with Blender's Node Compositor Images rendered using Yafaray can also work with Blender's powerful node compositor. There are several steps to take note when working with the compositor: 1. The render should not be exported to XML file. The render option should be set to Into Blender.

2. The 'Use nodes' must be activated at the Node editor window (as shown below)

3. In Post Processing section, 'Compositing' must be activated (as shown below).

Copyright Career Idea Site

65

3D Rendering with Yafaray for Blender

CHAPTER 8

CREATING FLORA FOR 3D SCENES


General Overview For certain scenes such as those for landscape and architectural visualization, there is often a need to create flora such as grass, shrubs and trees. This chapter focuses on some methods that can be incorporated to create vegetations for scenes that are to be rendered using Yafaray.

Copyright Career Idea Site

66

3D Rendering with Yafaray for Blender

Creating grass patches


There are multiple ways that grass patches can be included in the 3D scene for Yafaray render. One of the way is to make use of Blender's particle system. Yafaray can work with Blender's particle system to create effects such as particles and hair.

To generate grass using the particle system, the following steps are required: 1. Create and select a mesh object which will be the platform whereby grass will be 'grown' on. This mesh object will serve as the particle generator. 2. With the mesh object selected, go to the Particles Panel at the properties button. Click the '+' sign to add a new particle system.

3. Next go to Type and select the required types ( Emitter or Hair). To create grass, select Hair as the particle type. See screenshot below.

Copyright Career Idea Site

67

3D Rendering with Yafaray for Blender

Hair render process using Yafaray is much like that of using the Blender Internal Renderer. One might have to play with the parameters to get the desired look, density and effect for the grass patch. Under the Emission section,
Amount: controls the amount of grass Hair length: This value is used to determine the height of grasses.

Clicking 'Advanced' will display additional options. The Velocity Panel can be used to fine tune the look of the grass patch.

With the Velocity Panel on, Normal value can be used to determine height of grass. Velocity>> Random value can give the grass patch added realism by injecting a sense of natural randomness. Random value= 0 Random value = 0.05

Copyright Career Idea Site

68

3D Rendering with Yafaray for Blender

The colour of the grass patch is defined at the Material panel. For this example, it is given a basic green colour using Shiny diffuse shader

If the grass is rendered now, they will appear to look like sticks. This is as shown below.

This is because the width of each blade if of grass is to even and uniform. To fix that, we need to head back to the Particle system panel. The shape of individual strands of grass blade can be controlled at the Strand section of the Particle System panel. For this example, we will use the following settings as shown below

Copyright Career Idea Site

69

3D Rendering with Yafaray for Blender

Below shows the render using these settings in the Strand setting section. As you can see the base (root) of the grass is wider than the tip.

Below example is a grass patch with the Emission amount increased to 10000.

Copyright Career Idea Site

70

3D Rendering with Yafaray for Blender

Creating Plants and Trees


There are multiple ways that trees can be included in the 3D scene for Yafaray to render. One of the way is to make use of an external plant generator to design and create them.

A very good open source 3D modelling program for creating plants and trees that integrate well with Blender and Yafaray is Ngplant. As of this writing, Ngplant can be downloaded (for free) from http://www.ngplant.sourceforge.net/

Copyright Career Idea Site

71

3D Rendering with Yafaray for Blender

To create and render trees, the basic workflow is: Stage 1: Model tree in Ngplant Stage 2: Shading, texturing and rendering the tree within Blender/Yafaray Stage 1: Modelling tree in NGplant The interface for Ngplant can seems obscured at first. The following keys manipulate the 3D view Rotate: Middle-mouse button Zoom in/out: Middle-scroll wheel Pan: SHIFT + Middle-mouse button Basically, to work with this software, we need to understand the following workings:
1. by selecting the name of the branch (displayed on the lower right panel), its corresponding parameters are displayed on the right-side panels. In the screenshot below, Branch1 is selected

2. To add a new-branch, select the existing branch onto which the new branch will grow out from. Right-mouse click to display options. Go to Append branch>> New branch.

Copyright Career Idea Site

72

3D Rendering with Yafaray for Blender

3. Leaves are considered as branches too. For making leaves, the selected branch must use Quad as stem mode. To do that, select the intended branch. Right-mouse click to display options. Go to Stem mode >> Quad. This is as shown on the right

4. Leaves are quad meshes that will need to be applied a decal-type texture mapping procedure. For our workflow, the texture mapping should be applied within Blender.

Branch shaping and editing Ngplant has four section/panels for shaping and fine tuning branch parameters, namely Stem, Material, Branching and General The following will explore parameters of particular significance for our work. Stem Parameters of particular significance in this section Length influences the length/general height of the tree. Radius influences the thickness of the branch/trunk

Copyright Career Idea Site

73

3D Rendering with Yafaray for Blender

Material Parameters of particular significance in this section Base colour defines the colour of the branch/leave/trunk

Branching Parameters of particular significance in this section Rotangle defines the rotation angle of the branch/leave/trunk.

To facilitate easier material creation in Blender/Yafaray, the leaf layer should be given a
Copyright Career Idea Site

74

3D Rendering with Yafaray for Blender

colour that is different from that of the branches and trunk.

Once the tree model has been created in NGPlant, it can be exported as OBJ format file.

Copyright Career Idea Site

75

3D Rendering with Yafaray for Blender

Stage 2: Shading, texturing and rendering the tree within Blender/Yafaray Once the model is imported in Blender, we will need to apply materials and textures to the trunk, branches and leaves. The nice thing about the Ngplant export is that the trunk, individual branches and leaves are already well organised in terms of Material data. All leaves are already linked to a single material. In the screenshot below, leaves are all assigned to pmat4.

Copyright Career Idea Site

76

3D Rendering with Yafaray for Blender

Texture-mapping the leaves When texture-mapping the leaves, the procedure is as per the transparent decal method (that was described in the Texturing Chapter).
Basically, two textures maps have to be present: 1. A colour diffuse image map. This map determines the colour/RGB values for the leaf texture. This is as shown below.

2. A black and white image map to specify transparent regions. This is as shown below.

The texturing sequence should be as shown on the right. That is, Colour map should be stacked above the Black-white map for alpha.

Copyright Career Idea Site

77

3D Rendering with Yafaray for Blender

Colour diffuse map settings are as shown on the right. The essential settings are:
1. Under Yafaray Influence option, Diffuse Color must be enabled. 2. Yafaray Mapping (Map input) Coordinate must be set to UV. This is important for the texture to be positioned correctly.

Black white image map settings are as shown on the right. The essential settings are:
1. Under Image Sampling option, Calculate Alpha must be enabled. 2. Under Yafaray Influence option, Transparency must be enabled. This value should be set to -1.0 . 3. Yafaray Mapping (Map input) Coordinate must be set to UV. This is important for the texture to be positioned correctly.

Copyright Career Idea Site

78

3D Rendering with Yafaray for Blender

Shading and texturing the branches and trunk When shading and texture-mapping the branches, the level of details required largely depends on the intended usage of the final render. For scenes where there are numerous trees with no possibly of them coming up close to the camera, a simple base colour couple with the usage of inbuilt procedural texture may be sufficient. For this case, a brown diffuse colour and wood texture type are used.

Here is the final render, complete with materials for trunk, branches and leaves.

Copyright Career Idea Site

79

You might also like