threejs-worldgen
    Preparing search index...

    Interface TerrainCreateOptions

    Options for WorldTerrain.create.

    interface TerrainCreateOptions {
        buildBudget?: number;
        camera: Camera;
        castShadow?: boolean;
        createWorker?: () => Worker;
        jobsPerWorker?: number;
        keepAlive?: number;
        lodFactor?: number;
        material?: Partial<TerrainMaterialOptions>;
        minChunkSize?: number;
        origin?: Vec3;
        receiveShadow?: boolean;
        resolution?: number;
        rootSize?: number;
        scene?: Object3D<Object3DEventMap>;
        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.

    castShadow?: boolean

    Terrain casts shadows.

    createWorker?: () => Worker

    Creates a build worker (e.g. () => new TerrainWorker() with Vite's ?worker import of threejs-biomes/worker). Without it, chunks build on the main thread within buildBudget.

    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.

    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.

    scene?: Object3D<Object3DEventMap>

    Optional scene: the terrain adds itself and updates before each render.

    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

    How many workers to start when createWorker is given. Default: cores − 1, at most 4.

    world: World

    The world to render.