Sei sulla pagina 1di 16

YAFARAY CODE SPRINT 2012 _ Use cases

by Olivier Boscournu

http://www.configurateurvisuel.fr/fr/sticker-designer/367-sticker-encouleur.html

Hi and thanks for your interest for Yafaray. My name is Olivier


Boscournu, I'm a french freelance artist, by using for my projects,
several free graphic softwares like Blender and Yafaray. I work with
configurateurvisuel.fr since 2 years, to develop online configuration
solutions for e-shop.
For the needs of customers of its plugin "Sticker Designer", it's
sometimes necessary to create from scratch some interior
renderings. We'll see here that Yafaray is the ideal tool to produce
quickly and easily realistic scenes with a cropped wall, through the
various available passes. Its rendering parameters and the
configuration of materials, simple, allow the designer to work
effectively while respecting the delays and budget.

Modelling the scene


At the beginning of a project, turn the render engine directly to
Yafaray . Start by modelling the walls, floor and ceiling with the
window openings. Units are set on '' Metric''.

Set the camera by placing it perpendicular to the wall, with zero


rotation on axis Y and Z.

First light settings


add a lamp outside area, facing the interior and the same size as the
window. For now, leave the default power (1) to see what happens. It is
best to start a project with the default settings to get a better
understanding of light.
Render the scene to get the result of the lightning and to see how
the shadows behave. If needed, configure the power of the area lamp.
The pre-render can be done with simple cubes on the ground, the
best lightning solution for interior is Photon Mapping. At the begining,
let the settings by default.

In the bottom image, all the parameters are defaults except the area
lamp with a power of 2.

Material editing with Yafaray


very easy to use and to understand. As Blender material system, it's
quite basic but efficient and versatile enough to provide good
results. Sometimes Uvmapping is necessary to get the correct size
and orientation of a texture. For example the UV unwrapped floor is
easier to orientate. To see the result of the unwrapping directly in
the viewport, enable the '' Texture Solid'' button in the display panel
( shortcut N in the camera view).

Blend shading with Yafaray for the wooden floor.


The wooden floor is a blend of two materials, a matte and a glossy
for a hybrid material with caracteristic of each one. To do this, we
need to create 3 cubes in the scene (under the floor; off camera)
with three materials (matte, gloss, and blend).

Sofa and pillows


The sofa was directly modelled in Blender, in 8 different parts,
with an own fabric texture size for each ones. The shader is the
same, a ShinyDiffuse with the fabric texture on Color chanel half
multiplied.

Pillows are identical, one is unfolded with UV fabric texture, the other
with a floral pattern, to place the best maps. Three textures are used in
the Bump channel and color, the last for the Displacement modifier.
Books are imported from archives3d.net with their maps, shaders are
Shiny.

Making of the carpet


The carpet is a subdivided and sculpted plane with a "Solidify" modifier. An
Hair particles system is added. Hair are made from a plane with its own
particles system, animated with the " Hair dynamic" option. The new Hair
curves are extruded with a circle 8 sides.

The whole is then converted into a mesh used as duplicated " Object" in
the particles system of the carpet.

Render settings
Very often, the default settings of Yafaray give fairly good results. It
is always best to check the photon map to see if it's sufficiently
accurate. By checking the "Show Radiance map", the default photon
map looks like an impressionist painting. To improve resolution,
increase the number of '' Photons'', the '' Search Count'' and
decrease the value of '' Search radius''. The map will be more
accurate and dense, ready for final rendering.

Here the result of the default rendering settings Radiance Map. The
opened book for example is not well defined.

Here the result of the final rendering settings Radiance Map.


Elements are now much more recognizable.

Antialiasing
The AA must be precise enough to allow proper handling later
masks. Size rendering is 2000 x 2000 px, but the final composition
for the configurator is 600 px. Therefore it is not necessary to have
an excessive rendering time due to AA overgrown.

Final rendering settings: 2000 x 2000 px ( caustics disabled)


_Photons: 2 000 000
_Search radius: 0.1
_Search count: 1000
_Bounces: 5
_Samples ( for final gathering): 16
Anti-Aliasing:
_Passes: 4
_Samples: 2
_Additional samples: 2
_Pixelwidth: 1.200
_Threshold: 0.0050

Ambient Occlusion pass


The ambient occlusion allows to enhance the shadows, the contrast
between the values to get a less flat image.
Generally used alone, it's here calculated with the area light for the
projected shadows. In this scene, any transparent material is used,
so you just need to copy the entire scene, change "Photon Mapping"
to "Direct Light" and enable the '' Render clay'' and the '' Ambient
Occlusion''.
For each copy of a scene, the parameters of AA must be the same to
preserve consistency between the rendered images.

Object ID pass
Same manipulation for AO pass, simply copy the entire scene. This
rendering pass will be used to isolate objects by a color selection in a
photo editing software. This it is possible to change the color, saturation,
contrast, etc ... of each single object without affecting the rest of the
image.
In the case of the visual configurator, a wall sticker will be prepared and
handled on the wall, that's why it's necessary to produce this rendering
pass.

Ambient Occlusion settings for Object ID pass

Settings of materials for the Object ID pass

Post-compositing
Post-composition is partially done in the composite node editor in
Blender. This is made to merge in '' Multiply'' mode, the raw
rendering and the AO rendering to get shadows more frank. This is
the first step in a serie of improvements. Do not hesitate to play
with the different nodes and passes, to increase the realism of
rendering. Images from photo editing software, and not produced
with Yafaray, can be included in the post-compositing.

Masking in photo-editing tools


The wall is clipped and masked by the ID password (selected by
color) in editing software. A color overlay is merged over the back
wall. The composition is exported to Flash, who interpret it as the
mask color layer to generate different colors of walls and place a
wall sticker.

Example: configurateur visuel

Conclusion:
The whole project took only one half a day, including renderings
and checkings. With those scene settings, we're able to produce
several interior. As we can see Yafaray provides very good results
with an easy way to do it, and allows a fast and efficient workflow.
I hope you had fun reading this tutorial and it will be useful, and
have a good '' blending'' and '' yafaring''.
Best regards
Olivier Boscournu

Potrebbero piacerti anche