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.Wings3DMihnear1.7 - 17 Feb 2005 - 23:46 - MihneaDtopic end

Start of topic | Skip to actions

Yafray and Wings3D - A Match made outside of Heaven


Back to tutorials index
By Mihnea Dumitru

Relevant to Wings 0.98.26b | Yafray 0.0.7

Yafray is a command-line (i.e. MS-DOS) raytracing rendering engine. It's also free and sports a pretty active community of developers and associated nutters. The relationship between Wings3D and Yafray is, at best, something out of a Dilbert comic strip. It's as if you asked a group of engineers who had just finished work on the flux complexo-matic capacitator why the damn box isn't hot pink. Translated, it means Yafray is a powerful rendering engine... but you'll have to work on its settings a lot if you want good results. As well, keep in mind that in terms of Yafray, Wings is like the ugly cousin that you only want to see at family get-togethers. Blender is much better integrated with Yafray in comparison, and 99% of the help you'll find online will be for Blender's Yafray integration and settings. But, viewing those as well as playing around with the settings will get you started with Wings rendering.

Installing Yafray

  • Yafray can be downloaded from here.

  • Unzip the executable and install in C:\Yafray. This is very important. Wings3D doesn't handle spaces well in its Plug-in Preferences. I'm not sure if something other than C drive will work -probably should.

  • In Wings go to Edit: Plug-in Preferences: Yafray and enter the following information:

Download this .wings scene file (here). It contains a zip with some default settings for metal, glass and matte textures. Could be a lot better, but it should get you started, or at least give you an idea. You should have Yafray installed as a plug-in before opening this file.

Once opened, you can try to render it. Don't forget that the default Yafray scene setting is 100x100 pixels, you always change that by clicking the little square next to File: Render: Yafray, together with other settings such as blur, Antinoise and Fog settings. The rendering progress bar is actually a number of appearing # signs, either in the werl window or by opening the Console (Window: Console). If you installed Yafray correctly and after loading all the information, Yafray should start rendering. It's going to take a while (I think something like 20 minutes due to the fact it has GI and HDRI).

Yafray Material Settings

  • Wings Help for Yafray (accessible through the little ? button in all its light settings) states:
    • Object Parameters are applied to whole objects, namely those that have this material on a majority of their faces.
    • Mapping to Yafray object parameters:
      • Cast Shadow -> 'shadow'
      • Use Edge Hardness -> Emulate hard edges by slitting the object mesh along hard edges
      • Caustic -> Made the object caustic, i.e refract and reflect photons but not get hit by them.
      • Autosmooth Angle -> 'autosmooth'
    • Fresnel Parameters affect how rays reflect off and refract in glass-like materials. This is a different light model than the OpenGL (Diffuse, Specular, Shininess) model and they do not often go well together.
    • Set Default -> Sets 'transmitted' to Diffuse * (1-Opacity). This makes a semi-transparent object in OpenGL look the same in Yafray provided that Index of Refraction is 1.0.
    • Grazing Angle Colors -> Use the secondary Reflected and Transmitted colors following that show from grazing angles of the material. For a glass with green edges set Transmitted to white and Grazing Angle Transmitted to green.

Yafray Light Settings

  • Wings Help for Yafray (accessible through the little ? button in all its light settings) is pretty slim:
    • OpenGL properties that map to Yafray light parameters are:
      • Diffuse -> 'color'
      • All other OpenGL properties are ignored, particularly the Attenuation properties.
      • Yafray parameters mapping is pretty straightforward - the dialog field names should be self-explanatory.
      • Note: For a Yafray Global Photon Light (one of the Ambient lights) - the Power parameter is ignored.

  • Infinite lights get an extra jolt of settings with Yafray. They are pretty self-explanatory, you can choose the light's power, whether it casts shadows, and whether the background of the render will be all a certain color (Constant), Sunsky (horizon, sun, sky) or simply None (in this case the background of the render, provided there's nothing set up by you, will be the color defined in File: Render: Yafray: Default Background Color).

  • Point lights have a few more options, especially under Softlight Settings. Again, keep in mind that changing the Attenuation settings equals zero change in terms of the render.
    • res: Resolution of the shadowmap (only for volumetric shadows by now).
    • bias: Bias of the shadow map. 'Closeness' of the shadow to the object, if you have shadow that 'leaks' into areas it shouldn't, try decreasing the shadow bias.
    • radius: Radius of the blur (between shadowed and non-shadowed areas, creates the 'soft' look).

  • Area lights are extremely useful, especially since they behave as simple faces. So you can scale them, rotate them, generally affording more lighting control over a scene than any of the other lights. Also, area lights have 2 major pluses: 1) They have 'built-in' soft shadows, acting as lights on the length of the entire face. 2) As Global Photonlight Dummies (don't go "eh?") they emit photons. They are transformed from lights into particle emitters (so you'll need another light source right in front of the lightface to actually emit light). Photons bounce from objects, accounting for the caustics effect (The concentrated light reflections caused by refraction through a transparent surface: Renderosity Graphic Dictionary) that you can enable in an object's material. Mouthfull? Check this DAZ Bryce tutorial. Ignore any boobie ads and just look at the renders and you'll understand what it means smile

  • Spotlights are fun. You can control the angle or the spread of the light source. They can also be used as Photonlights. In this case, the settings are:
    • Use QMC: Use quasi monte carlo sampling, can lead to cleaner results, but also can sometimes cause patterns.
    • photons: Number of photons to trace, the more photons, the more information to generate the photonmap from. Generally speaking, you should need less photons for diffuse photonlights.
    • depth: Amount of reflections (bounces) or refractions the photons will perform.
    • fixedradius: Search radius when looking for photons (number of photons looked for is defined by 'search'.
    • search: Number of photons to gather while shading. higher values will soften the effect (when increasing the search, you should also increase the fixedradius).
    • cluster: This defines the smallest unit in the photonmap

  • Ambient lights aren't really 'seen' in Wings3D's geometry windows, but rather have an overall effect across the scene. You can access them through the Outliner window. They have three settings:
    • Hemilight - apparently this is the older setting in Yafray, and it regards Global Illumination (Global illumination algorithms used in 3D computer graphics are those which, when determining the light falling on a surface, take into account not only the light which has taken a path directly from a light source (local illumination), but also light which has undergone reflection from other surfaces in the world. -Wikipedia Definition ) or GI in a skydome. The Blender Manual states:
      • This indirect lighting system performs what is commonly called an 'Occlusion pass'. This produces a fast diffuse light in the scene by ignoring objects surface properties (colour) and just determining whether the point in question is in shadow or not. Because of this, the Hemilight will not produce colour bleeding between objects (unlike the pathlight). It uses either a Monte Carlo raytracing algorithm (MC), or a Quasi Monte Carlo raytracing algorithm (QMC). Since MC uses random sampling the results can be quite noisy. The more samples you take the less noise you'll see, of course this results in longer render time. QMC sampling on the other hand produces less noise, but sometimes can result in descernable patterns in the shading of objects. Both noise and patterns can be reduced with yafray built-in Anti Noise Filter.
      • The Hemilight will assume that the scene is evenly lit, as if a huge sphere surrounded the scene, lighting it with the color you specify in the 'color' tag. If you omit the color tag altogether, the hemilight will sample the render background if available (you can use this with HDRI backgrounds to get fast and realistic lighting simulations for compositing into a real scene).
    • Pathlight - full GI settings. The Blender Manual states:
      • This indirect lighting system performs 'global illumination' by taking light from background and diffuse objects. It uses either a Monte Carlo raytracing algorithm (MC), or a Quasi Monte Carlo raytracing algorithm (QMC). The results from either system can be rendered using an Irradiance Cache.
      • Since MC uses random sampling the results can be quite noisy. The more samples you take the less noise you'll see. Of course this results in a longer render time. QMC sampling on the other hand produces less noise, but sometimes can result in discernible patterns in the shading of objects. Both noise and patterns can be reduced with yafray built-in Anti Noise Filter.
      • Path Light will produce nice radiosity effects. It can also produce caustics, however, as the photons that produce the caustics are not focused in a specific direction like the photon light, the caustic patterns will be softer unless a huge number of samples are taken.

  • Ambient lights also have background settings as HDRI, Image, Constant, None. HDRI or High-Dynamic Range Image can be downloaded as .hdr files from the net and represent graphic (read: images) files that can be coated around an invisible sphere or dome around the object and even light the model. Image is what is says, Constant is color and None is... none.

  • And that's it folks! Yafray in Wings3D requires a whole lot of tinkering, specifically with glass caustics. The results, however, are spectacular (specular, too!).


Contributor: Main.MihneaD
Back to tutorials index

to top

You are here: UserDoc > Wings3DMihnea

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