SpeedTree
    Show / Hide Table of Contents

    Variance Editor

    Many generator properties have a variance value. This value describes the range in which the generator value can vary for each node. Variance can be applied using several algorithms; for example, let's examine the following image.

    A generator hierarchy with four identical trunks. Above each trunk is a Branch generator, each one with a different amount and type of variance. Above the hierarchy are labeled representations (A through D) of the variance type of each branch.

    Here we have four identical, simple trunks, each one generating 23 simple branches with an absolute length of 10.0. The only difference is the amount and type of variance on the "Spine:Length:Absolute" property.

    Trunk "A"

    Length variance is set to 0.0. All branches are exactly 10.0 units long.

    Trunk "B"

    Length variance is set to 3.0 and the distribution algorithm is "Uniform (random)." Each of its 23 branches has a length between 7.0 and 13.0 chosen at random.

    Trunk "C"

    Length variance is set to 3.0 and the distribution algorithm is "Gaussian (bell curve)." Each of its 23 branches has a length between 7.0 and 13.0, chosen based on a Gaussian distribution. Notice that the lengths are more closely clustered around 10.0 than in the purely random example.

    Trunk "D"

    Length variance is set to 3.0 and the "Cohesion" slider is set to "Cohesive," meaning branches closer together will exhibit less variance than branches further apart. Each of its 23 branches has a length between 7.0 and 13.0, chosen using a noise function based on the branch's position on its parent.

    Editing variance

    Click on the variance button of any generator property that has variance to bring up the Variance Editor (pictured below). The button will be a gray "+/-" when the variance is 0.0; otherwise, the variance amount will be rendered with a pink background.

    The Variance Editor.

    Edit the values on this dialog according to the descriptions below:

    Variance

    This is the amount by which the property can vary.

    Distribution

    This option controls how the amount of variance is computed per node. "Uniform (random)" chooses a random amount of variance per node. "Gaussian (bell curve)" uses a bell-shaped distribution where most of the variances are small amounts.

    Cohesion

    The elements in this group control the degree to which neighboring nodes will have similar variance values. Use this option to create clusters of similar objects in your model.

    Cohesive

    Use this slider to set how cohesive the variance pattern is, where higher cohesiveness means branches closer together will exhibit less variance than branches further apart.

    Scale

    Increase this value to tighten the noise pattern used to compute variance.

    Offset

    Modify this value to shift the noise pattern used to compute variance.

    Best practices

    Here's a short list of things to keep in mind when editing variance.

    • You need variance on at least some of the properties or "Randomize" won't do anything!
    • Use "Gaussian (bell curve)" when you want most of the values to be similar but with a few outliers.
    • Use cohesion to make very noticeable properties appear coordinated. A good example is "Season:Descendant offset" on branches. Adding cohesive variance to this property makes season changes in large sections of the tree appear varied but related to where they are on the model.
    Copyright © 2023 Unity Technologies
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX.