threejs-worldgen
    Preparing search index...

    Interface VegetationOptions

    Options of createVegetationLayers. Plain data except density and renderer.

    interface VegetationOptions {
        castShadow?: boolean;
        density?: ((species: string, x: number, z: number) => number) | null;
        impostor?: Partial<ImpostorOptions>;
        lodDistances?: [full: number, simplified: number, impostor: number];
        renderer?: Renderer | null;
        seed?: number;
        simplifiedDetail?: number;
        species: VegetationSpecies[];
        variants?: number;
        weather?: WeatherInputs;
    }
    Index
    castShadow?: boolean

    Whether mesh levels cast shadows (impostors never do).

    density?: ((species: string, x: number, z: number) => number) | null

    Per-position density multiplier for each species, e.g. biome weights: (name, x, z) => biomes.weights(x, z).forest. Multiplies the species' own density.

    impostor?: Partial<ImpostorOptions>

    Impostor bake settings.

    lodDistances?: [full: number, simplified: number, impostor: number]

    End distances of the full mesh, simplified mesh and impostor for a 15 m tree. Each species scales them by its size (clamped to ×0.12…×3), so ferns switch level sooner than redwoods.

    renderer?: Renderer | null

    An initialised WebGPURenderer: when given, far levels are baked octahedral impostors.

    seed?: number

    Seed for the variants' shapes.

    simplifiedDetail?: number

    Detail (0..1) of the simplified mesh level.

    What grows.

    variants?: number

    Generated variants per species (each a different seed; instances pick one at random).

    weather?: WeatherInputs

    Weather inputs for every generated material (see WeatherInputs); defaults follow the global treeUniforms.