threejs-worldgen
    Preparing search index...

    Interface CornOptions

    Options for Corn.create.

    interface CornOptions {
        buildBudget?: number;
        camera: Camera;
        canopyResolution?: number;
        castShadow?: boolean;
        chunkSize?: number;
        colorVariation?: number;
        debugLods?: boolean;
        dryColor?: string;
        fields?: CornField[];
        flattenResolution?: number;
        growth?: number;
        harvested?: boolean;
        height?: number;
        heightVariation?: number;
        interactionStrength?: number;
        interactors?: Interactor[];
        leafColor?: string;
        lods?: CornLOD[];
        patchiness?: number;
        plantSpacing?: number;
        receiveShadow?: boolean;
        renderer?: GrassRenderer;
        scene?: Object3D<Object3DEventMap>;
        seed?: number;
        shadowDistance?: number;
        soilColor?: string;
        stiffness?: number;
        stubbleHeight?: number;
        sun?: DirectionalLight | null;
        tasselColor?: string;
        terrain?: Terrain;
        translucency?: number;
        wind?: Partial<WindOptions>;
        youngColor?: string;
    }

    Hierarchy (View Summary)

    Index
    buildBudget?: number

    Milliseconds per frame spent building chunks, nearest first.

    camera: Camera

    The camera whose distance drives levels of detail.

    canopyResolution?: number

    Grid size (metres) of the canopy surface that stands in for far plants.

    castShadow?: boolean

    Whether plants within shadowDistance cast shadows.

    chunkSize?: number

    Edge length (metres) of the chunks plants are built in around the camera.

    colorVariation?: number

    0..1 per-plant brightness variation.

    debugLods?: boolean

    Tints corn by level of detail (red, yellow, green; canopy red → blue as it rises).

    dryColor?: string

    Dry leaf, husk and stubble colour.

    fields?: CornField[]

    The fields to plant, e.g. from threejs-city's farm planner.

    flattenResolution?: number

    Texel size (metres) of the map remembering where corn was flattened.

    growth?: number

    Growth stage: 0 seedling, ~0.65 full height, 0.8 mature (tassels and ears), 1 dry and brown.

    harvested?: boolean

    Harvested: only stubble is left.

    height?: number

    Mature plant height in metres, tassel included (1.5–3 m).

    heightVariation?: number

    0..1 random height spread per plant.

    interactionStrength?: number

    Global multiplier on how strongly interactors push and flatten corn. 0 = not at all.

    interactors?: Interactor[]

    Up to 16 objects that push corn aside and flatten what they drive over (tractor wheels, harvesters…).

    leafColor?: string

    Mature leaf colour (any CSS colour).

    lods?: CornLOD[]

    Exactly four levels of detail, near → far. Plants end at the last distance; the canopy covers the rest.

    patchiness?: number

    0..1 field-scale brightness and dryness variation.

    plantSpacing?: number

    Distance between plants along a row, in metres.

    receiveShadow?: boolean

    Whether plants and canopy receive shadows.

    renderer?: GrassRenderer

    Must be a WebGPURenderer (three/webgpu). Initialised if needed.

    scene?: Object3D<Object3DEventMap>

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

    seed?: number

    Layout seed: the same seed always plants the same fields.

    shadowDistance?: number

    Radius (metres) around the camera in which plants cast shadows.

    soilColor?: string

    Soil colour between young rows and under the canopy.

    stiffness?: number

    Higher = less wind and interaction bending.

    stubbleHeight?: number

    Stubble height in metres after harvest.

    sun?: DirectionalLight | null

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

    tasselColor?: string

    Tassel colour.

    terrain?: Terrain

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

    translucency?: number

    0..1 how much sunlight shines through back-lit leaves.

    wind?: Partial<WindOptions>

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

    youngColor?: string

    Young leaf colour.