Scene Description Language Overview
Prev | Chapter 30. YafRay | Next

## Scene Description Language Overview

Relevant to Blender v2.31

A YafRay Scene description file is an XML file complying to the definitions of this section. The renderer parses the XML from top to bottom. So if Block1 is referenced before Block2, it must be defined before Block2 (it must be above it in the XML).

    <scene>

    <shader type = "generic" name = "Default">
            <attributes>
                    <color r="0.750000" g="0.750000" b="0.800000" />
                    <specular r="0.000000" g="0.000000" b="0.000000" />
                    <reflected r="0.000000" g="0.000000" b="0.000000" />
                    <transmitted r="0.000000" g="0.000000" b="0.000000" />
            </attributes>
    </shader>

    <transform
    m00 = "8.532125" m01 = "0.000000" m02 = "0.000000" m03 = "0.000000"
    m10 = "0.000000" m11 = "8.532125" m12 = "0.000000" m13 = "0.000000"
    m20 = "0.000000" m21 = "0.000000" m22 = "8.532125" m23 = "0.000000"
    m30 = "0.000000" m31 = "0.000000" m32 = "0.000000" m33 = "1.000000"
    >
    <object name = "Plane" shader_name = "Default" >
            <attributes>
            </attributes>
                    <mesh>
                    <include file = ".\Meshes\Plane.xml" />
                    </mesh>
    </object>
    </transform>

    <light type="pathlight" name="path" power= "1.000000" depth "2" samples = "16" use_QMC = "on" cache"on"  cache_size="0.008000"  angle_threshold="0.200000"  shadow_threshold="0.200000" >
    </light>

    <camera name="Camera" resx="1024" resy="576" focal="1.015937" >
            <from x="0.323759" y="-7.701275" z="2.818493" />
            <to x="0.318982" y="-6.717273" z="2.640400" />
            <up x="0.323330" y="-7.523182" z="3.802506" />
    </camera>

    <filter type="dof" name="dof" focus = "7.97854234329" near_blur "10.000000" far_blur "10.000000" scale "2.000000">
    </filter>

    <filter type"antinoise" name"Anti Noise" radius = "1.000000" max_delta = "0.100000">
    </filter>

    <background type = "HDRI" name = "envhdri" exposure_adjust = "1">
            <filename value = "Filename.HDR" />
    </background>

    <render camera_name = "Camera" AA_passes = "2" AA_minsamples = "2" AA_pixelwidth = "1.500000" AA_threshold = "0.040000"
            raydepth = "5" bias = "0.300000" indirect_samples = "1" gamma = "1.000000" exposure = "0.000000" background_name"envhdri" >
            <outfile value="butterfly2.tga"/>
            <save_alpha value="on"/>
    </render>
    </scene>

Don't worry! It's not as complex as it looks. Concentrate on the bold highlighted tags.

The Tags work similar to HTML tags (also like brackets) each tag must have an opposite closing tag. Two tags together, with settings inside, is one block. A block can tell the renderer how to shade something, how big to render the image, what the shape of an object looks like, where it is etc etc.

In the example above, first a shader is defined, then an object (which is wrapped in its Transform Matrix), then a light is added then a camera, a filter, a background and finally the render settings (notice the closing </scene> tag).

Prev | Up | Next
Installation | Home | Shaders