User Tools

Site Tools


SCS Format

The SpeedTree® Compiler settings file (SCS) is written in XML format, and it represents all of the settings a user of the program can change for a particular compiler session. The format of the save file is described here so that other external applications can interface with the Compiler for more automation of the pipeline/process of compiling trees. An application would write an SCS file, call the Compiler from the command line, and await the output.

Every single property of every object does not need to be set. In fact, very few things need to be included to just load a tree and compile it. Anything that is ommitted from the SCS file will simply be set to the default value (the value it has when a new settings file is created).

Format

<?xml version="1.0" encoding="UTF-8"?>
<SpeedTreeCompiler>
    <General> 
        [All Properties for the General object]
    </General>
    <Textures>
        [All Properties for the Textures object]
    </Textures>
    <Compile>
        [All Properties for the Compile object]
    </Compile>
    <Atlases
        Count=[Number of atlases in this session]
    >
        <Atlas
            Name=[Name of this atlas]
        >
            [All Properties for this Atlas object]
            <Trees
                Count=[Number of trees in this atlas]
            >
                <Tree
                    Name=[Name of this tree (used on output files)]
                >
                    [All Properties for this Tree object]
                    <EffectLOD>
                        [All the Effect LOD settings for this tree]
                    </EffectLOD>
                    <WindLOD>
                        [All the Wind LOD settings for this tree]
                    </WindLOD>
                </Tree>
            </Trees>
            <Atlas_Textures>
                [These properties correspond to the Atlas Texture objects in the atlas.]
                [This entire section can be omitted if individual atlas texture scaling is not required.]
            </Atlas_Textures>
        </Atlas>
    </Atlases>
</SpeedTreeCompiler>

Properties

Each property in an object is specified in the same manner: the tag “Property”, the name attribute, and the value as a string attribute. Any property that is not explicitly set in the SCS file will be set to the default value.

The name value is a case-sensitive, colon-separated string describing the group hierarchy of that property. For example, the billboard atlas size on the Atlas object is has the name in the save file “Layout:Billboards:Atlas size”.

Checkboxes (booleans) have values that are either “true” or “false”. Enumerated properties (properties with a choice box) have a value corresponding to the choice. Paths are relative to the SCS file itself, but must be absolute when referencing a different drive or network share.

<Property Name="Layout:Billboards:Atlas size" Value="4">

Effect/Wind LOD

In each tree is a section of properties dealing with Effect LOD and Wind LOD. If these properties are not set, then the effect and wind LOD settings will correspond to the default settings, the “Standard” preset.

The value for the Wind LOD is a string of the wind settings for each LOD of the tree. The numbers correspond to the EWindLod enumeration in the SpeedTree® SDK. Note that these do not include the transitional types. Transitional types are computed by the Compiler when needed.

<WindLod Count="3"> 3 2 2 </WindLod>

Effect LOD is done per material. Each material is referenced by the material ID. This could make it difficult to set the effect LOD programmatically without knowing more about the tree. Usually a tree uses fewer than a dozen materials, however, so Effect LOD properties could be saved for IDs 1-20 to make sure all materials are covered. The value for each effect in the Effect LOD is a string of the effect choice for each LOD of the tree. The numbers correspond to the material enumerations in the SpeedTree® SDK (such as EDiffuseEffect, EDetailLayer, ESpecularEffect, etc.). Note that these do not include the transitional types. Transitional types are computed by the Compiler when needed.

The following effects correspond to the effect lod enumerations in the SpeedTree® SDK. The ones shown below are an example. Each number represents the effect for that LOD.

<EffectLod
    Count=[Number of materials to be described]
>
    <Material
        ID=[ID of the material]
    >
        <Diffuse Count="3"> 1 0 0 </Diffuse>
        <Contrast Count="3"> 2 1 1 </Contrast>
        <Specular Count="3"> 0 0 0 </Specular>
        <Transmission Count="3"> 0 0 0 </Transmission>
        <Detail Count="3"> 0 0 0 </Detail>
        <Lod Count="3"> 1 1 1 </Lod>
        <ShadowCast Count="3"> 1 1 1 </ShadowCast>
        <ShadowReceive Count="3"> 1 1 1 </ShadowReceive>
        <ShadowSmooth Count="3"> 0 0 0 </ShadowSmooth>
        <FaceCulling Count="3"> 1 1 1 </FaceCulling>
    </Material>
</EffectLod>