threejs-grass
    Preparing search index...

    Interface GrassOptions

    Options for Grass.create.

    interface GrassOptions {
        baseColor?: string;
        bladeHeight?: number;
        bladeWidth?: number;
        buildBudget?: number;
        camera: Camera;
        castShadow?: boolean;
        clumping?: number;
        clumpSize?: number;
        colorVariation?: number;
        curvature?: number;
        debugLods?: boolean;
        density?: number;
        grassMap?: GrassMap | null;
        heightVariation?: number;
        interactionStrength?: number;
        interactors?: Interactor[];
        lods?: GrassLOD[];
        maxDistance?: number;
        maxSlope?: number;
        patchiness?: number;
        preset?:
            | "kentuckyBluegrass"
            | "perennialRyegrass"
            | "tallFescue"
            | "bermudaGrass"
            | "zoysiaGrass"
            | "stAugustineGrass"
            | "buffaloGrass"
            | "fineFescue"
            | "toonMeadow"
            | "goldenSavanna"
            | "autumnHaze"
            | "frostbite";
        receiveShadow?: boolean;
        renderer?: GrassRenderer;
        scene?: Object3D<Object3DEventMap>;
        shadowDistance?: number;
        stiffness?: number;
        sun?: DirectionalLight | null;
        terrain?: Terrain;
        tileSize?: number;
        tipColor?: string;
        translucency?: number;
        type?: "blades" | "billboards";
        widthVariation?: number;
        wind?: Partial<WindOptions>;
    }

    Hierarchy (View Summary)

    Index
    baseColor?: string

    Blade colour at the root (any CSS colour).

    bladeHeight?: number

    Blade height in metres. Any height works (lawns ~0.1, meadows ~0.5, tall grass 1–3).

    bladeWidth?: number

    Blade width at the base in metres.

    buildBudget?: number

    Milliseconds per frame spent (re)building tiles, nearest first. Spreads work to avoid frame spikes.

    camera: Camera

    The camera the field is centred on and whose distance drives LOD.

    castShadow?: boolean

    Whether grass within shadowDistance casts shadows (needs a shadow-casting light).

    clumping?: number

    0..1 how strongly blades gather into tufts that splay outwards.

    clumpSize?: number

    Tuft diameter in metres.

    colorVariation?: number

    0..1 per-blade brightness variation.

    curvature?: number

    0..1 natural droop of blades when there is no wind.

    debugLods?: boolean

    Tints grass by LOD (red, yellow, green, blue) to help tune lods.

    density?: number

    Blades per square metre at full density (LOD 0).

    grassMap?: GrassMap | null

    Coverage/height control texture; see GrassMap. null = grass everywhere.

    heightVariation?: number

    0..1 random height spread per blade.

    interactionStrength?: number

    Global multiplier on how strongly interactors bend grass.

    interactors?: Interactor[]

    Up to 16 objects that push grass aside.

    lods?: GrassLOD[]

    Exactly four levels of detail, ordered near → far.

    maxDistance?: number

    Radius (metres) around the camera that has grass. Blades fade out over the last 15%.

    maxSlope?: number

    Steepest terrain gradient (rise / run) that still grows grass. Infinity disables the check.

    patchiness?: number

    0..1 field-scale light/dark and dry patches.

    preset?:
        | "kentuckyBluegrass"
        | "perennialRyegrass"
        | "tallFescue"
        | "bermudaGrass"
        | "zoysiaGrass"
        | "stAugustineGrass"
        | "buffaloGrass"
        | "fineFescue"
        | "toonMeadow"
        | "goldenSavanna"
        | "autumnHaze"
        | "frostbite"

    Starting look; any GrassStyle field you pass overrides the preset's value.

    receiveShadow?: boolean

    Whether grass receives shadows.

    renderer?: GrassRenderer

    Must be a WebGPURenderer (three/webgpu); it falls back to WebGL2 by itself. Initialised if needed.

    scene?: Object3D<Object3DEventMap>

    If given, grass is added to it and updates itself every frame via scene.onBeforeRender.

    shadowDistance?: number

    Radius (metres) around the camera in which grass casts shadows. Shadows are costly: keep it small.

    stiffness?: number

    Higher = less wind/interaction bending.

    sun?: DirectionalLight | null

    Light used for back-lit translucency. null = first DirectionalLight found in the scene.

    terrain?: Terrain

    Mesh/group to grow on (baked once into a heightfield), a (x, z) => y function, or omit for flat ground.

    tileSize?: number

    Edge length of a streaming tile in metres. Tiles are re-centred around the camera.

    tipColor?: string

    Blade colour at the tip (any CSS colour).

    translucency?: number

    0..1 how much sunlight shines through blades when back-lit.

    type?: "blades" | "billboards"

    Detailed geometric blades, or lightweight view-facing billboard tufts.

    widthVariation?: number

    0..1 random width spread per blade.

    wind?: Partial<WindOptions>

    Wind settings to change; unspecified fields keep their current value.