threejs-grass
    Preparing search index...

    Interface GrassProps

    Props of the <Grass> component: every GrassInput setting plus the ones below.

    interface GrassProps {
        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;
        paint?: false | Partial<Brush>;
        patchiness?: number;
        preset?:
            | "kentuckyBluegrass"
            | "perennialRyegrass"
            | "tallFescue"
            | "bermudaGrass"
            | "zoysiaGrass"
            | "stAugustineGrass"
            | "buffaloGrass"
            | "fineFescue"
            | "toonMeadow"
            | "goldenSavanna"
            | "autumnHaze"
            | "frostbite";
        receiveShadow?: boolean;
        ref?: Ref<Grass | null>;
        shadowDistance?: number;
        stiffness?: number;
        sun?: DirectionalLight | null;
        terrain?: Terrain | RefObject<Object3D<Object3DEventMap> | null>;
        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

    Camera the field follows. Defaults to the R3F default camera.

    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.

    paint?: false | Partial<Brush>

    Turns on the TerrainPainter with this brush (needs grassMap). false = off.

    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.

    ref?: Ref<Grass | null>

    Receives the underlying Grass instance (for sampleHeight, mapNode, stats, …).

    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 | RefObject<Object3D<Object3DEventMap> | null>

    Mesh/group (or a ref to one) — baked when the component mounts or the object changes — or a (x, z) => y height function. Inline functions are fine: the latest one is always used, but tiles already built keep their heights (call grass.setTerrain() to force a rebuild).

    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.