free rays for you
get it Get it get it Learn YafRay enjoy Enjoy contribute Contribute
Skip to topic | Skip to bottom
Home
UserDoc
UserDoc.ReleaseNotes008r1.49 - 30 Dec 2006 - 11:52 - AlvaroLunatopic end

Start of topic | Skip to actions



Yafray 0.0.8 Release Notes for Blender users
By Claus Andersen and Alvaro Luna.
May 2006


Based on commit logs by eeshlo and Kam's list of Yafray changes. Many thanks to them:
http://www.yafray.org/forum/viewtopic.php?t=332
http://www.yafray.org/forum/viewtopic.php?t=343

There is a polish translation of this document, made by ZoltanPL:
http://www.emergencyart.com/yafray/zmianyYafRay.html

Some of the models used in these notes can be found in the YafRay compilation of example files:
http://www.yafray.org/forum/viewtopic.php?t=1009


Lighting:

Point Light options

While in Blender interface appears as a sigle kind of light, in fact YafRay can translate Lamp settings into as many as three kind of lights, depending on the 3 possible configurations of shadow buttons:

  • If neither Ray Shado nor Buf.shadow are enabled, YafRay will translate it into a 'pointlight' block.

  • If the Ray Shadow button is enabled. If the radius value is 0, it is exported as a 'pointlight', always casting hard shadows, samples setting is ignored. If the radius is anything other than 0, then it is exported as a 'spherelight', which can cast soft shadows, and the Samples setting then controls the shadow quality. The 'spherelight', when used with photons, should now work better since it now samples from the sphere surface only, so using it with an emmiting object (sphere) at the same position works better, similar to the method used for arealight. Radius button controls sphere light size.


examplev.jpg
Example of Yafray spherelight used with a emitting sphere:
spherelights.jpg

  • If the Buf.Shadow button is enabled, it is exported as a yafray 'softlight', which is a 'pointlight' which uses shadowmaps. This can be used to fake soft shadows, also faster than arealights. Although parameters are similar to the Blender settings, for YafRay both the bias parameter and the shadowbuffersize can be lower than equivalent Blender settings. Remember that 6 shadowmaps are created in this case, so can use quite a bit of memory with large buffer settings.

shadowbuffer.jpg

Glow option

image 1

Point lights now have a simple glow option, a simple way to make lights visible. The basic effect looks like light in fog.

  • 'glow_intensity' controls the intensity and size of the glow, generally very low values (usually less than 0.01) are enough, since it also depends on the light intensity itself.

  • 'glow_offset' affects the central highlight of the glow, the higher this is set, the less 'peaked' the glow will be, untill it almost fades out and only a faint foggy effect around the lightsource is left.

  • 'glow_type' can be set to two types, though they can look similar, type two is best, but also a bit slower. First type is a simplified own hack, the second type is based on an idea described by Han-Wen Nienhuys in RTNews7v3 (also used in MegaPov).

NOTE: just like spotlight halo's, glow is not visible against the background, there must be another object behind it. The simplest solution is to use a large black shadeless plane behind your scene.

Example of glow option usage. 'Concep 17' by TjGk: Concept_17.jpg

GI Skydome

IRRADIANCE CACHE


cache.jpg

When Irrandiance Cache is activated, we are in fact using Full Global Illumination (pathlight) but in 'occlusion' mode.

In XML language, pathlight has a new 'mode' parameter, which can be set to 'occlusion', in which case instead of full Global illumination it will sample occlusion only.

<light type="pathlight" name="path_LT" power="3.000000" mode="occlusion"
cache="on" use_QMC="on" threshold="1.000000" cache_size="0.033333" 
shadow_threshold="0.950000" grid="82" search="35" 
ignore_bumpnormals="off" samples="2048" > </light>

The main advantage is the possibility of using an irrandiace cache. An irradiance cache speeds up the time of rendering Global Illumination renders by rendering a pre-pass to determine the best areas of an image to sample. On a large flat surface, for example, it can be assumed that the diffuse lighting will be fairly even so you would need less samples. Wheras in a corner, the lighting will change more drastically, requiring more samples. The irradiance cache tells the final GI render the best places to sample.

Example of irradiance cache:
irradiance.jpg

USE BLENDER AO SETTINGS (maxdistance)


blendeAO.jpg

There is a new option in the GI quality menu 'Use Blender AO settings', which will as it says use the most important AO settings for the skydome parameters. The only AO parameters used are 'Samples' and 'Dist'.

A Blender AO sample is equal to 32 Yafray samples, so 16 Blender AO samples (maximum) is equal to 512 Yafray samples. Notice that Yafray Best Quality is equal to 2048 samples.

Maybe the most interesting Blender AO value that Yafray will take into account will be Distance. Distance sets the length of the Oclussion rays and defines how far away other faces give the oclussion effect.

In XML language, both 'hemilight' and 'pathlight' in 'occlusion' mode have a new parameter 'maxdistance', with which the maximum distance to detect occlusion can be set. This means that like Blender's Ambient Occlusion, it can now be used in interior scenes as well.

This is an example about how Blender AO settings are translated into a Patlight block. Blender AO samples=5 and Blender AO Distance=10. Notice samples and maxdistance tags:

<light type="pathlight" name="path_LT" power="3.000000" mode="occlusion"
   cache="on" use_QMC="on" threshold="1.000000" cache_size="0.033333"
   shadow_threshold="0.100000" grid="82" search="35"
   ignore_bumpnormals="off"
   samples="160" maxdistance="10.000000" >
</light>

BUMPNORMALS (SkyDome and Full GI)


nobump.jpg

With 'full' GI and irradiance cache, one problem is bumpmaps, when using bump (or normal) maps, the sampling will be much more dense, using lots more rendertime.

As a temporary fix there is a button 'NoBump', but this also has the side effect that in areas of total indirect light (or when used with SkyDome cache) no bumpmapping will be visible. It is therefor best used with some direct light as well. For SkyDome with cache, and strong bumpmapping it might actually not make much difference, since for low distance values you can usually get away with low sample values as well.

Yafray FOG.


mist.jpg

Basic fog is supported as well. Though because there was not much time to complete the code, it is sort of unfinished, and you will have to tweak parameters specifically for YafRay again. It uses only the world horizon color, and only uses the Blender mist distance setting.
fog.jpg

In XML languaje, there are two new parameters inside the render block, which are fog_density value and fog_color r :
<render camera_name="MAINCAM"
   raydepth="5" gamma="1.500000" exposure="0.000000"
   AA_passes="4" AA_minsamples="4"
   AA_pixelwidth="1.500000" AA_threshold="0.050000"
   background_name="world_background"
 >
   <fog_density value="0.1" />
   <fog_color r="0.85" g="0.85" b="0.95" />
   <outfile value="c:\Documents and Settings\Alvaro\Escritorio\YBtest.tga" />
</render>






Shading

Mirror Transp Presets


presets.jpg

Since lots of users (especially yafray beginners) have had problems getting certain material aspects right, there is now a material preset menu available to hopefully solve some of the most common "How do I do this? It doesn't work!" questions seen in various forums. Choosing an option from this menu will set the required parameters to default values for yafray, and you can work your way from there to tweak it something you want.

mirrortransp.jpg

Most buttons are copies of the same Blender parameters, with some variations. Just like Blender 'Ray Mirror' enables reflection, 'Ray Transp' enables refraction. You can use 'ZTransp' for materials that have texture maps with alpha channels.

Again, same as Blender 'rayMir' sets the amount of reflection. Next button 'frsOfs' however controls fresnel offset, meaning that when this is set to 1, you will get no fresnel effect and when set to 5, reflection is totally determined by fresnel, which is important for forrealistic glass/metals/etc.

What is Fresnel?: http://www.hash.com/am2004/Rendering/Fresnel%20Term/Fresnel%20Term.htm

IOR is self-explanatory, same as Blender. When you have 'Ray Transp' enabled, the blender 'filter' button will appear next to the IOR button. This has the same effect as in Blender.

More information about filtering: http://www.blender3d.org/cms/Transparent_Filtering.514.0.html

Absorption Dispersion

In optics, dispersion is a phenomenon that causes the separation of a wave into spectral components with different wavelengths. This is what's happening when you see a rainbow after a thunderstorm. This is also visible when you look at a prism or a glass ball. Yafray is now capable of simulating this and you either have to edit your XML scenefile or use Blender to activate it:
      <dispersion_power value="0.800000" />
      <dispersion_samples value="30" />
      <dispersion_jitter value="off" />

If you want scattering on the ground on your scene a photonlight is needed (no photonlight used here)
dispersion.jpg

Absorption is, in short, when a material absorps a certain wavelength of light, letting others pass/reflect. For example, an object that absorbs blue, green and yellow light will appear red when viewed under white light. To get the effect change these variables in you XML scenefile:

      <absorption r="0.000000" g="5.000000" b="7.000000" />

absorption.jpg

These setting are also available through Blenders interface like so:
blender-AD.jpg

Dispersion

  • Pwr: Dispersion power, more means more presision - 0=no dispersion
  • Samples: Using too little samples will result in objects of a single color, or at least not representing the objects true color. For realistic materials, 25 maximum should be more than enough.
  • Jitter: Enables jittering of wavelengths - adds noise.

Absorpsion
  • DS: Absorpsion distance scale

A much more technical description can be found in the changelog for Yafray 0.0.8: http://projects.blender.org/viewcvs/viewcvs.cgi/yafray/src/shaders/blendershader.cc?cvsroot=yafray

Texture modulation and blending modes


textblend.jpg

All texture modulation modes with the exception of 'Amb' and 'Translu' are now supported. The supported texture mapping modes now includes 'raymir' as well. Transparency, as far as texturing is concerned, now works similar to Blender, with the exception that you still have to set alpha to a low value to get any transparency effect at all in Yafray.

All blending modes are supported as well.

Diffuse and Specular modes


shaders.jpg

All Blender BRDF models (aka 'shaders' for the Blender users) are now supported, and again, you won't necessarily get the same results as in Blender. The reason for that is partially of course the lighting differences, but also, not all Blender 'shader' implementations are actually correct, and copying those errors just for the sake of matching Blender results doesn't really seem like a good idea. Though this really is only the case for WardIso, less so for Minnaert and Blinn, which in YafRay are more or less (but not totally) a copy of the Blender code.

In any case, in practice those differences might not be too noticable at all.

Image texture

In XML language, the interpolation of Image textures has been changed, instead of the former on/off switch, it can now be set to three types of interpolation, 'none' for no interpolation, 'bilinear'(default) for bilinear interpolation, and for special cases 'bicubic'. The latter is a bit expensive and is best saved for things like low resolution backgrounds, or highly zoomed in textures, where it can considerably improve the otherwise blocky artifacts of bilinear interpolation.
interpol.jpg

From Blender point of view, when 'Interpol' button is activated in the image loader panel, YafRay will interpret it as "bilinear"(default), while if 'Interpol' button is not activated, YafRay will interpret it as "none" for no interpolation. If your want to use the third method "bicubic", you'll have to edit manually the XML file. Remember, the possible options are "bilinear", "none" and "bicubic". Notice the interpolate value tag in the below shader block:

<shader type="image" name="IMrembrandt-03.jpg" >
   <attributes>
      <filename value="F:\2006\rembrandt-03.jpg" />
      <interpolate value="none" />
   </attributes>
</shader>

More info about interpolation:
http://www.dpreview.com/learn/?/key=interpolation

HDRI as texture

High dynamic range images are now supported as texture images. (just make sure YafRay is compiled with OpenEXR support - http://www.openexr.com/ )

Utilizing this can make objects illuminate a scene.

Both HDR and OpenEXR images can be applied as normal textures in Blender (and in the XML scenefile):

<shader type="image" name="IMStageEnvLatLong.exr" >
   <attributes>
      <filename value="../StageEnvLatLong.exr" />
      <interpolate value="bilinear" />
   </attributes>
</shader>

Sphere textured with an HDRI-probe.
HDRI-texture.jpg
Sphere textured with an EXR-image:
EXR-texture.jpg

HDRI as background


hdri.jpg

Some minor changes have occured. Concerning Blender, World image backgrounds now use the Blender mapping settings as well, but only the 'AngMap', 'Sphere' and 'Tube' settings. But in YafRay those last two, unlike Blender, cover the whole view, not just the upper half, so is not really fully compatible with YafRay. So now you have to set one of these buttons too when loading a HDR lightprobe image.

Besides, 'Hori' must now be enabled for probes to work.

In YafRay XML language, though still supported for backwards compatability, backgrounds of type 'HDRI' can now completely be replaced by the 'image' type background (see XML in HDRI Prefiltering below). The image background now has the exact same functionality, including the 'exposure_adjust', which replaces the 'power' parameter (still supported but deprecated).

The 'mapping' parameter now also includes 'angular' though it is just another name for 'probe' mapping. Accepted parameters for the 'mapping' tag are "sphere","angular","probe","tube".

Exposure control is now a floating point value so anything in between 0 1 and 2 will work too.

Example of 'exposure_adjust' by Hassan:
789a33c7488778057688ab03963ac04b-.jpg

HDRI Prefiltering


filter.jpg

An overlooked feature is the 'prefilter' parameter. Setting 'Filter' (under image texture) higher than '1' will activate this option and then there's actual XML-editing. Applying it will get rid of lighting artifacts often experienced when working with HDR images:

<background type="image" name="world_background" exposure_adjust="0.000000" mapping="probe" >
   <filename value="/hdri/stpeters_probe.hdr" />
   <interpolate value="bilinear" />
   <prefilter value="on"/>   < !-- here! -- >
</background>

Examples of "on/off" prefiltering option:
no-pre-hdri.jpg pre-hdri.jpg

Clipmode


clipmodebuts.jpg

YafRay supports all of Blender Clipmodes. In fact, XML tags are called "cube", "clip", "clipcube", "checker" and "repeat" as in Blender.

clipmode.jpg

This is an example of a blendermapper, where clipping parameters are defined, such as clipping value, checker_mode value and checker_dist value:
<shader type="blendermapper" name="MAMaterial.002_map0">
   <attributes>
      <input value="IM060ppr.jpg" />
      ...
      <clipping value="checker" />
      <checker_mode value="odd" />
      <checker_dist value="0.000000" />
      <cropmin_x value="0.000000" />
      <cropmin_y value="0.000000" />
      <cropmax_x value="1.000000" />
      <cropmax_y value="1.000000" />
      <rot90 value="off" />
   </attributes>
</shader>

Procedurals


procedurals.jpg

Most Blender procedural textures are now supported, though stucci does not (and cannot) totally work the same as in Blender, and related to that, for similar reasons, the Blender 'nabla' bumpmap parameter is not used either, it will match Blender best if the default setting of 0.025 is used.

In XML language, besides the existing procedural shaders (marble, woods, clouds), there are aswell five new procedural shaders, which are:

  • voronoi
  • musgrave
  • distorted_noise
  • gradient
  • random_noise

Furthermore, inside every procedural shader, there are at least two new parameters:

  • noise_type which controls the noise type, as in Blender.
  • shape which controls the kind of wave to produce bands, as in Blender

In the noise_type field you can input the following noisetypes:

"blender", "stdperlin", "newperlin", "voronio_crackle", 
"voronoi_f1", "voronoi_f2", "voronoi_f3", "voronoi_f4", 
"voronoi_f2f1" and "cellnoise"

Shape can now be set to "sin", "saw", and "tri" as in the Blender settings.

Inside the XML file, the order of several shader blocks in order to produce, for instance, a procedural marble material would be:

  • First the Procedural shader, where noise_type and shape are defined, apart from other procedural parameters.
<shader type="marble" name="example_procedural" > 
<noise_type value="blender" /> 
<shape value="saw" /> 
... 

  • Second, the Blender mapper shader, where the texturing is defined, along with the procedural shader as input.
<shader type="blendermapper" name="example_textura"> 
<input value="example_procedural" /> 
... 

  • And finally the Blender shader, where the material final aspect is defined, using the Blender mapper shader as input.
<shader type="blendershader" name="example_material" > 
<input value="example_textura" /> 
...

Kam has written an excellent YAFRay v0.0.8 Procedural Shader Reference, with lots of examples: http://www.geocities.com/kam_b_lai/tutorials/procedural/yashader_ref.htm
cloud_voronoi_crackle_size5.jpg

Ramps

Though Blender ramps are now partially supported, they cannot work in all cases the same in YafRay, since Blender and Yafray have totally different lighting models. The main issues are:

  • 'Result' ramp input mode is not supported at all.
  • 'Energy' ramp input mode also won't generally give the same results as in Blender.
  • The only ramp shader that will work properly when used with GI is the 'Normal' ramp input mode.
  • When ramp is in 'energy' or 'shader' mode and using it with GI enabled, YafRay can only 'see' the underlying material color, not the ramps, which results in a mix of the ramp colors (from direct light) with the material color (from indirect light).
  • All blending modes are supported.

ramps.jpg

The basic purposes of Blender ramps are still applicable to YafRay. You'll find more information about ramps in the Blender Wiki: http://mediawiki.blender.org/index.php/Manual/PartIII/Ramp_Shaders

Example of YafRay Ramps, by Jendrzych:
yafrayglass6xs.jpg

In XML language, Yafray Ramps are defined first by colorband shaders, one for each type of Ramps (color and specular), where color and modulators (ramp steps) are defined:

<shader type="colorband" name="MAMaterial_difframp" >
   <attributes>
   </attributes>
   <modulator value="0.000000" >
      <color r="0.000000" g="0.000000" b="0.000000" a="0.000000" />
   </modulator>
   <modulator value="1.000000" >
      <color r="0.000000" g="1.000000" b="1.000000" a="1.000000" />
   </modulator>
</shader>

<shader type="colorband" name="MAMaterial_specramp" >
   <attributes>
   </attributes>
   <modulator value="0.000000" >
      <color r="0.000000" g="0.000000" b="0.000000" a="0.000000" />
   </modulator>
   <modulator value="1.000000" >
      <color r="0.000000" g="1.000000" b="1.000000" a="1.000000" />
   </modulator>
</shader>

Finally there should be a blendershader block, where previous colorband shaders are called, respectively, in diffuse_ramp value and specular_ramp value tags. There are several ramps parameters in the blendershader block as well:

<shader type="blendershader" name="MAMaterial" >
   <attributes>
      <color r="0.800000" g="0.800000" b="0.800000" />
      <specular_color r="1.000000" g="1.000000" b="1.000000" />
      <mirror_color r="1.000000" g="1.000000" b="1.000000" />
      <diffuse_reflect value="0.800000" />
      <specular_amount value="0.500000" />
      <alpha value="1.000000" />
      <emit value="0.000000" />
      <matmodes value="traceable shadow" />
      <diffuse_brdf value="lambert" />
      <specular_brdf value="blender_cooktorr" />
      <hard value="50" />
      <diffuse_ramp value="MAMaterial_difframp" />
      <diffuse_ramp_mode value="shader" />
      <diffuse_ramp_blend value="mix" />
      <diffuse_ramp_factor value="1.000000" />
      <specular_ramp value="MAMaterial_specramp" />
      <specular_ramp_mode value="shader" />
      <specular_ramp_blend value="mix" />
      <specular_ramp_factor value="1.000000" />
   </attributes>
</shader>

Anisotropic models

In XML, all you really need to do is set the specular_brdf tag to either 'ward' or 'ashikhmin'. To control the specular shading there are two parameters for the u & v directions, u_roughness and v_roughness respectively. If they both have the same value, the shader looks similar to other specular shaders like phong or blinn (specularity is 'isotropic'). So for anisotropic shading, they both should have different values.

In xml this would look something like:

  <specular_brdf value="ward" /> 
  <u_roughness value="0.8" /> 
  <v_roughness value="0.15" /> 

If you use Blender, you could just export a scene which uses the ward specular, and then edit the xml to XML change the u & v roughness params, or set the specular_brdf to 'ashikhmin'.

In case anyone would want to do that, lets say you would want to recreate images as seen in the ashikhmin paper, which refers to the parameters Nu and Nv to control the anisotropic shading. For consistency the YafRay u & v roughness are always in the range 0 to 1, but the paper uses numbers from 0 to infinity. To convert those numbers for use with yafray, simply set 'u_roughness' to 1/Nu and 'v_roughness' to 1/Nv. So if Nu=10 and Nv=1000, set 'u_roughness' to 0.1 and 'v_roughness' to 0.001. So the larger Nu/Nv, or as far as YafRay is concerned, the smaller u/v roughness, the sharper the specular shading.

To get a similar look as the 'ward' example above (for a simple sphere at least), the xml code could look something like:

  <specular_brdf value="ashikhmin" /> 
  <u_roughness value="0.8" /> 
  <v_roughness value="0.015" /> 

Then about controlling the anisotropic directions of the shading. We'll spare you the details of the how & why, which probably would only confuse, but in any case, that is a rather complicated issue when dealing with polygons, so it probably all will still sound rather confusing nevertheless. There are two ways the tangent axes can be controlled, either by texture coordinates (uv or orco), or just let yafray 'guess'. Both have their pro's & cons.

Using texture coordinates has the advantage that the anisotropic directions will 'stick' to the surface, they will not change when the mesh is deformed, on the other hand, shading can have artifacts if the mesh is not sufficiently tesselated (low-poly models). Another disadvantage of using uv coords is that it is probably very difficult to set up if you really want to exactly control the directions. But in Blender, probably the most common one, u aligned to X, v aligned to Y, can be more or less achieved by using 'cylinder' uv-mapping assigned from front view. Yet another disadvantage is that there is only one set of uv (or orco) coordinates, so it might not be possible to use other textures on the same object, unless they happen to use the exact same mapping.

Things are 'simpler' when using nurbs or surface patches in Blender, then by enabling the 'uv orco' button ('Curve and Surface' panel, editing section), Blender will assign the exact correct parametric texture orco cords for these shapes. But parametric surfaces are not used very often in Blender.

Then you can also just let yafray 'guess' the tangents, this has the advantage that the shading is always smooth, but then again, also has the disadvantage that the anisotropic directions are fixed to a main axis, so shading will change when the mesh deforms or rotates. Of course all this might be less of an issue if you're not doing animation.

There is also an additional parameter available in yafray, called anisotropic_angle, which allow you to rotate the tangents, the value is in degrees.

Yes, We know, it's all giant confusing mess, isn't it...

Subsurface Scattering


SSS.jpg
Render by oort

SubSurface Scattering is now supported in Yafray - It is by no means physical correct but rather a quick hack. A new version that will replace the current one is under way. SSS is only accessable by XML editing your scenefile. In the example below, in first place there is a sss block where SSS parameters are defined. In second place there is a blendershader block, where the sss block is called in the environment value tag. Yafray shaders are located at the beginning of XML files:
<shader type="sss" name="w_ssstest_10">
   <attributes>
      <color r="1.0" g="1.0" b="0.0"/>
      <radius value="1.5"/>
      <samples value="100"/>
   </attributes>
</shader>

<shader type="blendershader" name="MAamarillo" >
   <attributes>
      <color r="1.000000" g="1.000000" b="0.000000" />
      <specular_color r="1.000000" g="1.000000" b="1.000000" />
      <mirror_color r="1.000000" g="1.000000" b="1.000000" />
      <diffuse_reflect value="0.800000" />
      <specular_amount value="0.500000" />
      <alpha value="1.000000" />
      <emit value="0.000000" />
      <matmodes value="traceable shadow" />
      <diffuse_brdf value="lambert" />
      <specular_brdf value="blender_cooktorr" />
      <hard value="50" />
      <environment value="w_ssstest_10" />
   </attributes>
</shader>

Finally, objects to have the SSS look will call the blendershader block in the shader_name tag:

<object name="OBCube" shadow="on"  shader_name="MAamarillo" >
   <attributes>
   </attributes>
   <mesh autosmooth="0.1" has_orco="off" >
      <points>
         <p x="12.030326" y="4.124888" z="3.882569" />
         <p ...


A short description on Subsurface Scattering can be found on wikipedia.org:
http://en.wikipedia.org/wiki/Subsurface_scattering

Conetrace block

A much overlooked feature of Yafray is it's ability to create blurry reflections without the use of bumpmaps. It is used to get reflections or transmitted color from environment.

It must be noted that this isn't an anisotropic shader, nor is it fully correct, it can however produce very good renders.

To get the effect a few steps must be taken:

1. Create your scene and apply a normal reflective material to your object just as you nomally would.

2. Export your scene to XML and open it for editing.

3. Copy/Paste the conetrace block into the XML before the reflective objects shaderblock. (this is essential) Note the name of the conetrace-block.

4. Now find your object material and enter the name of the conetrace-block as an 'environment value' (just before "/attributes")

<environment value="env" />

5. Tweak (look below for explanation) the values of the conetrace-block, save and launch 'yafray scenefile.xml'

XML example of chromeball with conetrace:


<shader type="conetrace" name="env" reflect="on" angle="7" samples="5" IOR="1">
      <attributes>
         <color r="0.5" g="0.5" b="0.5" />
      </attributes>
</shader> 

<shader type="blendershader" name="MAball" >
   <attributes>
      <color r="0.800000" g="0.800000" b="0.800000" />
      <specular_color r="1.000000" g="1.000000" b="1.000000" />
      <mirror_color r="1.000000" g="1.000000" b="1.000000" />
      <diffuse_reflect value="0.800000" />
      <specular_amount value="1.568463" />
      <alpha value="1.000000" />
      <emit value="0.000000" />
      <IOR value="1.000000" />
      <reflect value="on" />
      <reflect_amount value="1.000000" />
      <fresnel_offset value="0.937500" />
      <reflected r="1.000000" g="1.000000" b="1.000000" />
      <min_refle value="0.937500" />
      <matmodes value="traceable shadow" />
      <diffuse_brdf value="lambert" />
      <specular_brdf value="blender_cooktorr" />
      <hard value="249" />
      <environment value="env" />
      
   </attributes>
</shader>

This will render an image similar to this:

conetrace.jpg

Parameters for conetrace:
reflect: 'on' will reflect the ray, 'off' will refract the ray.
angle: determines the distortion/grainyness of the reflection 0 for clear reflections.
samples: samples on the reflection. 0 for none.
IOR: index of refraction. 1 for none.
color: filtering color for incoming light.

Toon Edge

First of all, you just have to make sure that you have also used a 'toon' diffuse shader, because currently the edge shading can not be used separately. It basically works best for a spherical objects, but sometimes it can look good enough on other objects, depending on the sort of effect you are looking for.

Second, you have to edit the XML file to add a 'toondiffuse_edge' parameter to the blendershader. This extra parameter controls the edge shading thickness, 0 is no edge, 1 is all edge, or in other words a totally black object. This is not an exact edge thickness control, the method used will result on a non-uniform thickness, basically depending on incident angle. There is also currently no way to control the edge color, it is always black.

In XML, the blendershader could look something like this, the 'toon' shader itself is set here to a very flat shading to make the edge shading more obvious:

 ... 
  <diffuse_brdf value="toon" /> 
  <toondiffuse_size value="3.140000" /> 
  <toondiffuse_smooth value="1.000000" /> 
  <toondiffuse_edge value="0.5" /> 
  ...

The difficulty maybe is that shadows can be black as well, making the edge difficult to see. But even if you don't use shadows, triangles turned away from the light are still not shaded by yafray either, so are also black. In the example below the Blender toon settings were set to max (Size=3.14, smooth=1) to get a totally flat shading, and the lightsource is more or less somewhere directly behind the camera so there is very little shadowing and the least amount of unshaded triangles are visible. It is just done to make the edge shading more visible.
YBtest.jpg






Rendering

Antialiasing

In XML laguage, the renderer block has an option 'clamp_rgb', which is to be used for normal output (doesn't matter if set for float ouput anyway, is bypassed) so that anti-aliasing around fast high contrast changes in the image will work better, it also tends to speed up AA as well, having to do less work. This is not advisable when using the DoF bokeh options, since it tends to weaken the lens shape details.

In the Blender GUI, this option is controlled by the 'Clamp RBG' button, in the Render panel, by default on.
clampRGBa.jpg

Note: 'Auto AA' is no longer enabled automatically for certain GI quality settings, we thought it best to leave it to the user to decide.

DOF

Depth of field (DOF) is the distance in front of and behind the subject which appears to be i focus. Yafray can handle this via the Blender interface (or XML editing). When Yafray is selected as renderer, the Edit-buttons for the camera changes to this:
dof12.jpg

Pressing 'limits' and switching to the 'Yafray DoF' tab shows the clipping distance of the camera and it is this line that helps you set the focal point (notice the yellow cross on the line):
dof3.jpg

Next option is 'Aperture'. The size of the aperture determines how blurred the out-of-focus objects will be. A rule of thumb is to keep it between .100 and .500.

'Random sampling' does exactly what is says.

'Bokeh' controls the shape of out of focus points when rendering with depth of field enabled. This is mostly visible on very out of focus highlights in the image. There are currently seven types to choose from:

  • 'Disk1' is the default, the same as was used before.
  • 'Disk2' is similar, but allows you to modify the shape further with the 'bias' parameter (see below).
  • When Triangle/Square/Pentagon/Hexagon is choosen, in addition to the bias control, you can offset the rotation with the 'Rotation' parameter (in degrees).
  • 'Ring', a weird ring shaped lens, no additional controls.

The 'bias' menu controls the accentuation of the shape. Three types available, uniform, center or edge, with uniform the default.

Notes on using DoF with Yafray: Enabling and using Dof in Yafray requires higher sampling rate to get a nice blurred effect. In the render-settings for Yafray, disable 'Auto AA' and increase the 'AA Samples' and 'AA Passes'.

Setting the 'AA threshold' value to zero is not necessary, lowering can help smooth the picture, but setting it to zero in fact will do anti-aliasing on every pixel whether it needs it or not. So better to just lower it bit, but not set it to totally zero.

Setting a high number of 'AA passes' is also not really going to make all that much difference, the main smoothness factor that makes the most difference is really the amount of 'AA samples'. A single pass with a high number of samples may be sufficient. And that tends to work best for use with bokeh as well.

Here is a few examples to demonstrate the effects of DoF:
dof45.jpg
dof6.jpg

Much more generic information on 'DoF' and 'Bokeh' can be found on wikipedia.org

Camera modes

Yafray supports Blender perpective and ortho Blender cameras straight from the Blender buttons. Besides that, YafRay also supports two additional camera modes, which can be accesed only by XML editing, which are "spherical" and "lightprobe". These cameras are typically used to produce high dynamic range imaging (HDRI).

In XML language, there are 4 new types of camera, which are "perspective", "ortho", "spherical" and "lightprobe". Both in spherical and in lightprobe mode, view zoom is controlled by the distance between the camera and the objects to render. This is the aspect of a camera block, with the type tag set to "spherical" mode:

<camera name="MAINCAM" type="spherical" resx="480" resy="480"
   focal="1.000000" aspect_ratio="1.000000"
   dof_distance="0.000000" aperture="0.000000" use_qmc="on"
   bokeh_type="disk1" bokeh_bias="uniform" bokeh_rotation="0.000000" >
   <from x="0.000000" y="-10.000000" z="0.000000" />
   <to x="0.000000" y="-9.000000" z="0.000000" />
   <up x="0.000000" y="-10.000000" z="1.000000" />
</camera>

The output of a "spherical" YafRay camera is a 360º view:
spherical.jpg

The output of a "lightprobe" YafRay camera have the typical round look of the lightprobes you can find on the Internet:
lightprobe.jpg

Render output

Yafray supports current Blender "border" button (Render panel). This feature allows to render a small-cut out the image, instead of rendering it all.

Yafray also supports exr output. If you want it as simple as possible, then just wait for the next version of Blender, which will support exr, so you can just use F3 to save to exr, just like any other image format that blender supports. Saving an image is totally independent of YafRay. If you want to do it now, by editing the xml, that really is also not very hard at all.

<render camera_name="MAINCAM" 
   raydepth="5" gamma="1.000000" exposure="0.000000" 
   AA_passes="2" AA_minsamples="4" 
   AA_pixelwidth="1.5" AA_threshold="0.05" bias="0.001000" clamp_rgb="on" 
   background_name="world_background" 
 > 
   <outfile value="/home/eeshlo/YFexport/YBtest.tga" /> 
</render>

Now all you need to do to save to the image as an exr file is to add the 'output_type' parameter and set it to 'exr'. It is also helpful to change the extension type of the file as set in the outfile parameter, not really needed, it is still an exr file, but it might be confusing if the file still looks like a .tga file. So for the above example, change YBtest.tga to YBtest.exr. You can add the extra 'output_type' parameter in one of two ways, here is one:

<render camera_name="MAINCAM" 
   raydepth="5" gamma="1.000000" exposure="0.000000" 
   AA_passes="2" AA_minsamples="4" 
   AA_pixelwidth="1.5" AA_threshold="0.05" bias="0.001000" clamp_rgb="on" 
   background_name="world_background" 
 > 
   <output_type value="exr" /> 
   <outfile value="/home/eeshlo/YFexport/YBtest.exr" /> 
</render>

And that really is all that there is to it. Now render the xml file with 'yafray YBtest.xml' or whatever the name of your file is, and you will find the exr in the directory as set by the 'outfile' parameter. Exposure & gamma correction are both bypassed when 'hdr' or 'exr' is the output type. That's it.

More info about EXR: http://www.openexr.com/
to top

I Attachment sort Action Size Date Who Comment
glow.jpg manage 7.3 K 21 Apr 2006 - 10:26 AlvaroLuna  
cache.jpg manage 7.5 K 22 Apr 2006 - 09:13 AlvaroLuna  
blendeAO.jpg manage 14.7 K 22 Apr 2006 - 23:38 AlvaroLuna  
nobump.jpg manage 7.9 K 23 Apr 2006 - 18:28 AlvaroLuna  
Concept_17.jpg manage 445.6 K 23 Apr 2006 - 18:48 AlvaroLuna  
interpol.jpg manage 13.6 K 24 Apr 2006 - 11:22 AlvaroLuna  
clampRGB.jpg manage 11.0 K 25 Apr 2006 - 08:46 AlvaroLuna  
clampRGBa.jpg manage 11.0 K 25 Apr 2006 - 08:48 AlvaroLuna  
irradiance.jpg manage 35.6 K 25 Apr 2006 - 10:01 AlvaroLuna  
dof1.jpg manage 9.6 K 25 Apr 2006 - 12:37 AlvaroLuna  
dof2.jpg manage 6.3 K 25 Apr 2006 - 12:38 AlvaroLuna  
dof3.jpg manage 30.0 K 25 Apr 2006 - 12:38 AlvaroLuna  
dof4.jpg manage 14.3 K 25 Apr 2006 - 12:38 AlvaroLuna  
dof5.jpg manage 14.5 K 25 Apr 2006 - 12:38 AlvaroLuna  
dof6.jpg manage 13.5 K 25 Apr 2006 - 12:39 AlvaroLuna  
dof3a.jpg manage 27.6 K 25 Apr 2006 - 12:53 AlvaroLuna  
yafray-HDRI-texture.jpg manage 15.4 K 25 Apr 2006 - 21:42 ClausA  
SSS.jpg manage 52.4 K 25 Apr 2006 - 22:11 ClausA  
HDRI-texture.jpg manage 10.3 K 27 Apr 2006 - 19:39 ClausA  
dispersion.jpg manage 51.4 K 26 Apr 2006 - 13:16 ClausA  
absorption.jpg manage 51.5 K 26 Apr 2006 - 13:33 ClausA  
blender-AD.jpg manage 15.3 K 26 Apr 2006 - 13:50 ClausA  
spherical.jpg manage 59.5 K 26 Apr 2006 - 19:39 AlvaroLuna  
lightprobe.jpg manage 9.6 K 26 Apr 2006 - 20:01 AlvaroLuna  
dof12.jpg manage 15.4 K 27 Apr 2006 - 07:06 AlvaroLuna  
dof456.jpg manage 44.0 K 27 Apr 2006 - 07:07 AlvaroLuna  
dof45.jpg manage 29.9 K 27 Apr 2006 - 07:12 AlvaroLuna  
EXR-texture.jpg manage 11.2 K 27 Apr 2006 - 21:54 ClausA  
ramps.jpg manage 12.6 K 28 Apr 2006 - 21:48 AlvaroLuna  
yafrayglass6xs.jpg manage 27.0 K 28 Apr 2006 - 21:49 AlvaroLuna  
procedurals.jpg manage 15.2 K 28 Apr 2006 - 22:19 AlvaroLuna  
blending.jpg manage 16.7 K 30 Apr 2006 - 09:15 AlvaroLuna  
texture.jpg manage 13.6 K 30 Apr 2006 - 09:17 AlvaroLuna  
spherelight.jpg manage 14.1 K 02 May 2006 - 21:16 AlvaroLuna  
shadowbuffer.jpg manage 8.3 K 30 Apr 2006 - 14:19 AlvaroLuna  
textblend.jpg manage 23.7 K 30 Apr 2006 - 14:33 AlvaroLuna  
conetrace.jpg manage 11.3 K 30 Apr 2006 - 17:34 ClausA 350x260
mist.jpg manage 20.6 K 01 May 2006 - 13:42 AlvaroLuna  
fog.jpg manage 4.9 K 01 May 2006 - 14:02 AlvaroLuna  
presets.jpg manage 19.1 K 01 May 2006 - 18:52 AlvaroLuna  
mirrortransp.jpg manage 10.6 K 01 May 2006 - 18:57 AlvaroLuna  
shaders.jpg manage 10.8 K 01 May 2006 - 19:35 AlvaroLuna  
clipmode.jpg manage 46.4 K 01 May 2006 - 20:36 AlvaroLuna  
spherelights.jpg manage 14.1 K 02 May 2006 - 21:17 AlvaroLuna  
examplev.jpg manage 11.2 K 03 May 2006 - 06:24 AlvaroLuna  
no-pre-hdri.jpg manage 49.1 K 04 May 2006 - 18:57 ClausA  
pre-hdri.jpg manage 34.4 K 04 May 2006 - 18:58 ClausA  
hdri.jpg manage 21.0 K 04 May 2006 - 20:08 AlvaroLuna  
filter.jpg manage 13.1 K 04 May 2006 - 20:18 AlvaroLuna  
789a33c7488778057688ab03963ac04b-.jpg manage 152.6 K 09 May 2006 - 21:17 AlvaroLuna  
YBtest.jpg manage 16.2 K 24 Jun 2006 - 13:04 AlvaroLuna  
YBtest.xml.gz manage 175.0 K 24 Jun 2006 - 13:07 AlvaroLuna  

You are here: UserDoc > ReleaseNotes008

to top

Copyright © 1999-2008 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback