threejs-worldgen
    Preparing search index...

    Interface VegetationSpecies

    One kind of plant (or rock) in a vegetation set. Any placement rule left out gets a sensible default for the kind (rocks tilt onto the slope and sink in, trees stand upright and avoid cliffs).

    interface VegetationSpecies {
        align?: number;
        cluster?: ScatterCluster | null;
        colorVariation?: number;
        density: number;
        group?: string;
        maxHeight?: number;
        maxSlope?: number;
        minHeight?: number;
        minSlope?: number;
        name: string;
        params?: Partial<TreeParams> | Partial<RockParams>;
        randomYaw?: boolean;
        scale?: [min: number, max: number];
        sink?: number;
        spacing?: number;
        tilt?: number;
        variants?: number;
    }

    Hierarchy

    Index
    align?: number

    0 = stand upright, 1 = tilt fully onto the terrain normal (rocks), anything between blends.

    cluster?: ScatterCluster | null

    Clumping into patches and clearings, or null for an even spread.

    colorVariation?: number

    Per-instance brightness variation, 0..1, sent as scatterParams.y: multiply it into your material's colorNode (scatterParamsNode().y) before any weather, so snow and ash stay untinted. Not sent as instanceColor, which three.js multiplies in after colorNode.

    density: number

    Share (0..1) of the blue-noise points this species takes.

    group?: string

    Layers with the same group share one blue-noise point set and never overlap: each point goes to at most one layer, chosen by comparing a per-point random number against the layers' densities (in layer order). The group's spacing is the first layer's. Defaults to the layer's own name (its own point set).

    maxHeight?: number

    Highest terrain height, in metres.

    maxSlope?: number

    Steepest terrain slope (rise / run) that gets instances. Infinity = no limit.

    minHeight?: number

    Lowest terrain height, in metres.

    minSlope?: number

    Lowest terrain slope (rise / run) that gets instances.

    name: string

    A species preset ('oak', 'spruce', …), a rocks preset ('boulder', …), or any name when params is given.

    params?: Partial<TreeParams> | Partial<RockParams>

    Overrides on top of the preset: tree params, or rock params for rock presets.

    randomYaw?: boolean

    Turn each instance by a random angle around its up axis.

    scale?: [min: number, max: number]

    Uniform scale range [min, max]; each instance picks a random value in it.

    sink?: number

    How far each instance is pushed into the ground, in metres (hides the base on slopes).

    spacing?: number

    Minimum distance between instances, in metres (Poisson-disk radius).

    tilt?: number

    Maximum random lean of each instance away from vertical, in radians (applied before align).

    variants?: number

    Distinct generated variants (overrides VegetationOptions.variants).