SPECIES DEFINITIONS

The <species>.xml file goes in the vegetation folder beside the other files for the vegetation and should be formatted as follows:

<?xml version="1.0" encoding="utf-8"?>
<SpeciesList>
    <!-- Define a species -->
    <Species name="[SPECIES NAME]">
        <!-- Define variations within the species -->
        <Variations>
            <Variation spawnRatio="0.75">
                <Size min="5" max="7"/>
                <Imposter stiffness="0.9" frames="8" textureIndex="0"/>
            </Variation>
            <!-- Further variations here -->
        </Variations>
        <!-- The material used for any imposters in this species -->
        <Material name="[MATERIAL NAME]"/>
    </Species>
    <!-- Further species here -->
</SpeciesList>

Here you must include the <SpeciesList> element, and the rest of the XML is comprised of the elements listed on this page. You can find a complete example of a species file here:

 

 

<GrassMaterial />

This element defines a material to be used on the ground as a "grass" texture for the biome that the all the defined species will be used in. This is an optional, self-closing element and has the following attribute:

 

Attribute Description Type Required
guid

This GUID of the grass texture to use for the species.

String Yes

 

 

<SpeciesList>

This element is a container element for one or more <Species> elements. It has no attributes.

 

 

<Species>

This element defines a single species that can then be used to populate a biome. Each species can have one or more <Variation> elements and requires a <Material> element too. It has the following attribute:

 

Attribute Description Type Required
name

This is the name of the species. This will be used to set a biome <Species> element.

IMPORTANT! If the species name is not unique, it will override any previously loaded species of the same name.

String Yes

 

 

<Variations>

This element is a container element for one or more <Variation> elements. It has no attributes.

 

 

<Variation>

This element defines a variation on the species being defined. Each <Species> requires at least one variation but can have more. It can have the <Size />, <Impostor />, and <MaskColor /> sub elements, and has the following attribute:

 

Attribute Description Type Required
spawnRatio This defines the rate at which the variation is picked over other variations of the same species. If the attribute is not set then it will default to 1. Float No

 

 

<Size />

This is a required sub-element for a <Variation> and is a self-closing. It is used to define the size range (in meters) of the variation, and has the following attributes:

 

Attribute Description Type Required
min The minimum size for the variation (in meters). Float Yes
max The maximum size for the variation (in meters). Float Yes

 

 

<Impostor />

This is a required sub-element for a <Variation> element and tells Microsoft Flight Simulator information about how the vegetation impostors should be rendered (vegetation is rendered using octahedral impostors, which is a low-cost method used to render a lot of similar items - like trees, bushes, etc... - using a combination of billboards, texture atlas and shaders). This element is a self-closing element, and has the following parameters:

 

Attribute Description Type Required
stiffness Defines the resistance to the wind of the species. A value from 0 to 1. Float Yes
frames The number of frames along one edge of the texture atlas. The texture atlas must be square and have the same number of frames along the width and the height. For an example, please see here: Texture Arrays Integer Yes
textureIndex The index into the texture array that is being used to generate variations for the species. If no texture array is being used then this should be set to 0. Please see here for more information: Texture Arrays Integer Yes
relativeOffsetY This value can be used to set a relative offset from the ground for the impostor used to render the vegetation. Value is in meteres. Float No

 

 

<MaskColor />

By default, all vegetation will be colored to suit the aerial photogram of the terrain on which is placed. However, this colouring is done over the full texture, which may not be what is required. For example, if you have a tree texture, you wouldn't want the trunk to be colored the same as the foliage, which is when you would use this element. This element sets a mask color which is used to prevent the aerial colouring being used for a specific section of the texture. This element is a sub-element of <Variation> and is self-closing with the following attributes:

 

Attribute Description Type Required
r The red component of the color to mask, from 0 to 1. Float Yes
g The green component of the color to mask, from 0 to 1. Float Yes
b The blue component of the color to mask, from 0 to 1. Float Yes
maxDistSquared

This is the squared maximum "distance" from the mask color after which aerial colouring will be applied to the material texture. This is a value between 0 - 1, and the squareroot of this value will be used to calculate the colours that fall inside/outside of the mask.

Float Yes

 

 

<Material>

This element is used within the <Species> element definitions to set the material that will be used to texture the vegetation. You only have one material assigned per-species. This is a self-closing element with the following attribute:

 

Attribute Description Type Required
name The GUID of the material that is to be used. You can get the GUID for any material using the Copy GUID option from The Material Inspector File menu. String Yes

 

For further information on how to set up materials to be used for vegetation, please see the Texture Arrays section of the documentation.