threejs-worldgen
    Preparing search index...

    Interface SourceTable

    A weighted list of spawn points that the CPU refreshes cheaply. positions is count × 4 floats (x, y, z, weight), data is count × 4 free floats per source, motion is velocity and opacity per source (moving emitters: vehicle exhausts), cdf the running sum of weights that the GPU binary-searches with a random number.

    interface SourceTable {
        cdf: Float32Array;
        count: number;
        data: Float32Array;
        motion: Float32Array;
        order: number[];
        positions: Float32Array;
        total: number;
    }
    Index
    cdf: Float32Array

    Inclusive prefix sum of weights per source.

    count: number

    Sources in use.

    data: Float32Array

    Four free floats per source (read by the shading and forces as source.data).

    motion: Float32Array

    Velocity xyz and opacity per source (default 0, 0, 0, 1).

    order: number[]

    Scratch list of the sources kept, reused by fillSourceTable (no garbage per refresh).

    positions: Float32Array

    x, y, z, weight per source.

    total: number

    Sum of weights.