threejs-worldgen
    Preparing search index...

    Interface WorldTerrainProps

    Props of <WorldTerrain>: every terrain setting plus the ones below.

    interface WorldTerrainProps {
        buildBudget?: number;
        camera?: Camera;
        castShadow?: boolean;
        createWorker?: () => Worker;
        jobsPerWorker?: number;
        keepAlive?: number;
        lodFactor?: number;
        material?: Partial<TerrainMaterialOptions>;
        minChunkSize?: number;
        origin?: Vec3;
        receiveShadow?: boolean;
        ref?: Ref<WorldTerrain | null>;
        resolution?: number;
        rootSize?: number;
        skirt?: number;
        viewDistance?: number;
        workers?: number;
        world: World;
    }

    Hierarchy (View Summary)

    Index
    buildBudget?: number

    Milliseconds per frame spent building chunks on the main thread (when there are no workers).

    camera?: Camera

    Camera that drives the level of detail. Defaults to the R3F default camera.

    castShadow?: boolean

    Terrain casts shadows.

    createWorker?: () => Worker

    Creates build workers (e.g. Vite: () => new TerrainWorker() from threejs-biomes/worker?worker).

    jobsPerWorker?: number

    Chunk jobs in flight per worker.

    keepAlive?: number

    Frames an unused chunk stays cached before it is freed.

    lodFactor?: number

    A chunk splits when the camera is closer than size × lodFactor (higher = more detail further out).

    material?: Partial<TerrainMaterialOptions>
    minChunkSize?: number

    Chunks never get smaller than this, metres (0.5 lets an ant walk on centimetre-scale ground).

    origin?: Vec3

    Floating origin: the world position that sits at render-space (0, 0, 0). Keep it near the camera (see FloatingOrigin) so float32 GPU precision holds from orbit down to ant scale.

    receiveShadow?: boolean

    Terrain receives shadows.

    ref?: Ref<WorldTerrain | null>

    Receives the underlying terrain instance (stats, uniforms, setOrigin, …).

    resolution?: number

    Vertices per chunk side (e.g. 33 = 32 × 32 quads).

    rootSize?: number

    Edge length of a level-0 chunk on flat worlds, metres.

    skirt?: number

    Skirt depth as a fraction of the chunk's edge length (hides cracks between LODs).

    viewDistance?: number

    Flat worlds: terrain is drawn out to this distance from the camera, metres. Planets cull by the horizon.

    workers?: number

    Number of workers when createWorker is set.

    world: World

    The world to render (see useWorld).