YafaRay is a free open source Monte Carlo raytracing engine produced by the YafaRay Team. Raytracing is a rendering technique for generating realistic images by tracing the path of light through a 3D scene.

Visit the YafaRay website
YafaRay documentation
YafaRay crash course


YafaRay4tS is an open source scripting project created by members of the trueSpace community to add functionality to trueSpace7.61 for exporting YafaRay formatted XML files for reading by the YafaRay render engine. Please note that YafaRay4tS is provided without warranty or guarantee of fitness for any purpose. It is provided "as is" and any use of this software is done at your own risk.

Visit the YafaRay4tS Project website (archived)

YafaRay4tS - Features Overview

YafaRay4tS is implemented as an XML exporter that uses batch scripting to interface with YafaRay command line XML interface.

The YafaRay4tS user interface exposes the YafaRay render settings for you, so that you can have full control over the output produced. Included in the YafaRay4tS distribution are several features to make using YafaRay with trueSpace easier. This ranges from several optional Viewers to see your rendered results, to the YafaRay specific Light objects and YafaRay specific Direct3D materials for use inside trueSpace. Care was taken in designing the scene export to allow it to support as many of the built in trueSpace geometry types as possible, ranging from Sub-division surfaces to Morph objects. While vertex normals are not supported by YafaRay, YafaRay4tS does allow for an auto-smoothing angle to be set on a per object basis.

YafaRay4tS - Panels

While an icon interface is included with YafaRay4tS for convenience, most of the render settings work is done in the YafaRay4tS user interface panels. The YafaRay4tS project has focused on implementing as much of the full YafaRay features set as is possible from within trueSpace. As can be seen, YafaRay4tS is well on the way to complete YafaRay support! Much thought has gone into placing the YafaRay features and settings into logical groupings of panel elements to make the interface easier to use without sacrificing the full customizability and power of the YafaRay render engine.

Direct Lighting - At the top of each panel is the lighting method that will be used by the YafaRay render engine. When you choose a lighting method from this combo control from the Stack, it will switch to that lighting method aspect. Every lighting method has a common Anti-Aliasing Settings, General Settings, Output - Render File, and their relevant settings. This does not work from the Link Editor.

-- Anti-Aliasing Settings --

Filter - 3 Anti-Aliasing reconstruction filters to use when resampling:

Gaussian - Slight blurring

Mitchell-Netravali - Improves sharpness of the edges Default

Box - Equal weighting of all samples.

Min Sample - Number of samples to use on first Anti-Aliasing pass.

Pixel Width - Width of Anti-Aliasing pixel filter. [0-8]

Passes - Maximum number of Anti-Aliasing passes.

Inc Sample - Number of samples for additional Anti-Aliasing passes.

Threshold - Color threshold for additional Anti-Aliasing samples in next pass.

-- General Settings --

Ray Depth - Amount of times that rays can be reflected in specular surfaces or pass through transparent surfaces.

Transparent Shadow depth - Amount of transparent surfaces that shadow rays can get through to find light sources.

Gamma In - The default gamma value for all colors, lights and textures.

This value is used to convert these values to linear color space used by the Yafaray renderer.

Gamma Out - The gamma value target for the rendered image.

CPU Threads - Number of CPU threads used by YafaRay. [-1] All threads.

This number should be equal to the number of CPU threads in your computer or minus one if you find that using all the

CPU threads bogs down your computer.

Normal Shadows / Transparent Shadows - Switches from Normal to Transparent Shadows.

Save Alpha - Exports an alpha file in addition to the RGB output file.

Z - Channel - Enable the Depth Channel in the output file.

Clamp RGB - Color depth is reduced to a low dynamic range before Anti-Aliasing filtering.

-- Output Render File --

View - If enabled YafaRay will render the Workspace view.

Camera - If enabled YafaRay will render the set Camera view.

Width - The width of the image rendered.

Height - The height of the image rendered.

>File name for rendered image output. This is where the rendered results will be saved.

Open Output Folder - Opens the folder entered into the above path.

Render - Exports XML file and spawns the YafaRay renderer.

YafaRay Lights

YafaRay lights differ from trueSpace's built-in light objects so a set of lights has been created for YafaRay4tS to make it easy and intuitive to set up lights from within the trueSpace scene editing environment. The custom YafaRay specific light objects are available via a light library that is installed into the trueSpace main libraries when YafaRay4tS is installed.

Also an icon fly out for easy access to the custom light objects has been added to the YafaRay4tS toolbar next to the YafaRay Render and Settings icons fly out. All of the YafaRay light types are represented from within trueSpace. Each of the light objects has settings panels that will show up in the trueSpace's stack view panel tab, exposing the YafaRay specific light settings for easy editing.

While it is impossible to accurately represent YafaRay photo realistic lighting from within trueSpace's real time viewport, care was take to get as close an approximation as was practical. For example the YafaRay4tS light objects include built-in scripting so that adjusting the YafaRay parameters for power and size will cause the amount of light generated in the real time display to be updated as the values are changed. Also each light includes a convient color picker for the lights color and a Color aspect for advaned color options.

YafaRay4tS Setup

Included with YafaRay4tS is a YafaRay Setup library that includes:

  • YafaRay4tS.RsScn with YafaRay Light setup and a Yafaray Camera.
  • Update to YafaRay4tSv0.9.0.RsObj script that is used to update older scenes.
  • YafaRay4tS toolbar.RsObj script that reloads the toolbar.
  • YafarayVolume.RsObj Volume Region object for Uniform and Height Fog.
  • Yafaray Camera.RsObj includes script to select DOF distance.
  • Several objects that are used semi automatically to create a D3D Preview of the Background.

YafaRay Materials

Included with YafaRay4tS are custom trueSpace Direct3D materials. These materials mirror the YafaRay materials Shiny Diffuse, Glossy, Coated Glossy, Glass, Rough Glass, Blend, Texture Map in with which you can add an Image, Procedural Clouds, Marble, Wood, Voronoi, plus one special Light Material used to indicate that an object is to be used as an object light. Also included is a Blend Material Collection (3D Object) used with the YafaRay Blend material. It loads automatically when you Load the YafaRay Blend material for blending two materials together.

By using Direct3D materials the user is able to get rudimentary feedback within the trueSpace real time display as to how the materials will look when rendered. It also allows for the user to use the built-in trueSpace tools for applying and inspecting the material. The YafaRay material settings have been added to the material panel so that they can be easily edited when viewing the material in trueSpace's Material Editor. Unfortunately because of the limitations of DirectX9 reflections and refraction cannot be simulated in the real time viewport. Instead, specular faking and specular mapping are implemented in the DirectX materials to help give the impression of reflective surfaces.

New Update - Clinton Reese @ Clintons 3DCreations has single handedly brought the newest version of YafaRay v3.3.0 to YafaRay4tSv0.9.9 for trueSpace 7.61 and trueSpace 7.61 Standalone.

Almost all of the code has been revamped making it more efficient and fixed several items that were not working properly. He has developed a D3D Preview that closely matches YafaRay rendered results for Workspaces D3D real time view. All of the Background types and Materials, including his newly developed Blend, Texture Map, and Procedurals materials, are created with just a few clicks of a D3D Preview button. He has integrated YafaRay4tS into Workspaces Offline Renderer. Be sure to read the Beta Releases in the History page for all of the improvements and additions.