threejs-worldgen
    Preparing search index...

    Interface NightLightField

    Night-light brightness per H3 cell as flat typed arrays (GPU-ready), plus point samplers.

    interface NightLightField {
        cellEdge: number;
        cells: string[];
        centers: Float64Array;
        intensity: Float32Array;
        local: Float32Array;
        population: Float32Array;
        resolution: number;
        sample(px: number, py: number, pz: number): number;
        sampleLocal(x: number, z: number): number;
    }
    Index
    cellEdge: number

    Average cell edge on this world, metres (a glow radius for point sprites).

    cells: string[]

    H3 index per cell.

    centers: Float64Array

    Base-surface world position of each cell centre, [x, y, z] per cell (planet-centred on planets).

    intensity: Float32Array

    0…1 brightness per cell.

    local: Float32Array

    Local [x, z] of each cell centre, per cell.

    population: Float32Array

    People per cell.

    resolution: number

    H3 resolution of the cells.

    • Brightness of the cell containing a base-surface world position (0 outside the region).

      Parameters

      • px: number
      • py: number
      • pz: number

      Returns number

    • Brightness of the cell containing local [x, z] (0 outside the region).

      Parameters

      • x: number
      • z: number

      Returns number