threejs-worldgen
    Preparing search index...

    Interface ParticleSystemConfig

    Construction options of a ParticleSystem: settings plus object inputs (not JSON).

    interface ParticleSystemConfig {
        capacity?: number;
        curves?: { color?: string[]; opacity?: number[]; size?: number[] };
        emitter?: {
            position?: [number, number, number];
            shape?: EmitterShape;
            size?: [number, number, number];
            spread?: number;
            temperature?: [number, number];
            velocity?: [number, number, number];
        };
        forces?: {
            ambientTemperature?: number;
            buoyancy?: number;
            cooling?: number;
            drag?: number;
            gravity?: number;
            gridLift?: number;
            turbulence?: number;
            turbulenceScale?: number;
            turbulenceSpeed?: number;
            wind?: [number, number, number];
            windShear?: number;
        };
        grid?: ParticleGrid
        | null;
        life?: [number, number];
        lighting?: ParticleLighting;
        maxPerFrame?: number;
        maxSources?: number;
        noise?: Data3DTexture;
        rate?: number;
        render?: {
            absorption?: number;
            albedo?: [string, string];
            anisotropy?: number;
            aspect?: number;
            blackbody?: boolean;
            blending?: "additive" | "alpha" | "premultiplied";
            capHeight?: number;
            detail?: number;
            detailDistance?: number;
            glow?: string;
            glowStrength?: number;
            intensity?: number;
            lightSteps?: number;
            opacity?: number;
            refraction?: number;
            shading?: ParticleShading;
            shadowSteps?: number;
            silverLining?: number;
            size?: number;
            sizeRandom?: [number, number];
            softness?: number;
            sort?: boolean;
            stretch?: number;
        };
        seed?: string
        | number;
    }

    Hierarchy (View Summary)

    Index
    capacity?: number

    Pool size: the most particles alive at once. Changing it rebuilds the GPU buffers.

    curves?: { color?: string[]; opacity?: number[]; size?: number[] }

    Shape over life (0 → 1), each an evenly spaced list of 1 to 8 keys.

    Type Declaration

    • Optionalcolor?: string[]

      Colour (#rrggbb); multiplied by the blackbody colour when render.blackbody.

    • Optionalopacity?: number[]

      Opacity multiplier.

    • Optionalsize?: number[]

      Size multiplier.

    emitter?: {
        position?: [number, number, number];
        shape?: EmitterShape;
        size?: [number, number, number];
        spread?: number;
        temperature?: [number, number];
        velocity?: [number, number, number];
    }

    Spawn shape and initial state.

    Type Declaration

    • Optionalposition?: [number, number, number]

      Centre, local space, metres.

    • Optionalshape?: EmitterShape

      point, box (half extents size), disc (radius size[0], on XZ), sphere (radius size[0]) or sources (see threejs-particles!ParticleSystem.setSources).

    • Optionalsize?: [number, number, number]

      Box half extents / disc and sphere radius in [0]; for sources, the jitter half extents around each source.

    • Optionalspread?: number

      Random extra speed in a random direction, m/s.

    • Optionaltemperature?: [number, number]

      Initial temperature range, kelvin (drives buoyancy, cooling and blackbody colour).

    • Optionalvelocity?: [number, number, number]

      Initial velocity, m/s.

    forces?: {
        ambientTemperature?: number;
        buoyancy?: number;
        cooling?: number;
        drag?: number;
        gravity?: number;
        gridLift?: number;
        turbulence?: number;
        turbulenceScale?: number;
        turbulenceSpeed?: number;
        wind?: [number, number, number];
        windShear?: number;
    }

    What moves particles.

    Type Declaration

    • OptionalambientTemperature?: number

      Ambient air temperature, kelvin.

    • Optionalbuoyancy?: number

      Buoyancy: up-acceleration = 9.81 × buoyancy × (T − ambient) / ambient (Boussinesq).

    • Optionalcooling?: number

      Exponential cooling towards ambient, 1/s.

    • Optionaldrag?: number

      Drag towards the air velocity, 1/s.

    • Optionalgravity?: number

      Gravity, m/s² (down).

    • OptionalgridLift?: number

      With a grid: up-acceleration from the grid's channel 0 (heat h), gridLift × h / (1 + h) m/s².

    • Optionalturbulence?: number

      Curl-noise turbulence, m/s².

    • OptionalturbulenceScale?: number

      Eddy size, metres.

    • OptionalturbulenceSpeed?: number

      How fast the eddies change, 1/s.

    • Optionalwind?: [number, number, number]

      Air velocity, m/s; drag pulls particles towards it.

    • OptionalwindShear?: number

      Wind grows by this share per 100 m above emitter.position.y (wind shear).

    grid?: ParticleGrid | null

    Grid to read heat and density from (lift, smoke self-shadowing).

    life?: [number, number]

    Life range, seconds.

    lighting?: ParticleLighting

    Shared sun/sky light (default: a new one; call lighting.fromScene(scene)).

    maxPerFrame?: number

    Most particles spawned in one update (caps catch-up after a long frame).

    maxSources?: number

    Most sources (see ParticleSystem.setSources). Default 4096.

    noise?: Data3DTexture

    Noise volume for turbulence and per-pixel detail (default: the shared 64³ volume).

    rate?: number

    Particles per second. With emitter.shape: 'sources' this is per unit of source weight, so a bigger fire front spawns more. Throttled so the pool never runs out (capacity / mean life).

    render?: {
        absorption?: number;
        albedo?: [string, string];
        anisotropy?: number;
        aspect?: number;
        blackbody?: boolean;
        blending?: "additive" | "alpha" | "premultiplied";
        capHeight?: number;
        detail?: number;
        detailDistance?: number;
        glow?: string;
        glowStrength?: number;
        intensity?: number;
        lightSteps?: number;
        opacity?: number;
        refraction?: number;
        shading?: ParticleShading;
        shadowSteps?: number;
        silverLining?: number;
        size?: number;
        sizeRandom?: [number, number];
        softness?: number;
        sort?: boolean;
        stretch?: number;
    }

    How particles are drawn.

    Type Declaration

    • Optionalabsorption?: number

      Smoke: light absorbed per unit of density.

    • Optionalalbedo?: [string, string]

      Smoke albedo for clean (white) smoke and dirty (dark) smoke; particles mix by their source tint.

    • Optionalanisotropy?: number

      Smoke: Henyey-Greenstein anisotropy (0 isotropic … 0.9 strongly forward).

    • Optionalaspect?: number

      Height / width of each quad.

    • Optionalblackbody?: boolean

      Colour from temperature (blackbody) instead of only the colour curve.

    • Optionalblending?: "additive" | "alpha" | "premultiplied"

      additive (sparks), alpha (smoke) or premultiplied (flames: emit light and partly hide what is behind).

    • OptionalcapHeight?: number

      Smoke: height above the emitter (metres) where the plume caps into bright, dense, sharply billowing pyrocumulus-like cloud. 0 = off.

    • Optionaldetail?: number

      Per-pixel noise detail 0…1 (0 = flat sprites, cheapest).

    • OptionaldetailDistance?: number

      Beyond this camera distance (metres) the per-pixel detail and self-shadow taps fade out.

    • Optionalglow?: string

      Smoke: warm light from below (#rrggbb), scaled by how hot the particle still is.

    • OptionalglowStrength?: number

      Smoke: glow strength.

    • Optionalintensity?: number

      Brightness multiplier (HDR; > 1 blooms).

    • OptionallightSteps?: number

      Smoke with a grid: per-particle density steps towards the sun through the grid (0…8). Rebuilds the compute pass.

    • Optionalopacity?: number

      Opacity multiplier.

    • Optionalrefraction?: number

      Haze: screen-space refraction strength (fraction of the screen).

    • Optionalshading?: ParticleShading

      Built-in shading: unlit sprites, noise-shaped flame tongues, lit volumetric smoke, thin spark streaks, refracting haze.

    • OptionalshadowSteps?: number

      Smoke: per-pixel density taps towards the sun (0…4). Rebuilds the material.

    • OptionalsilverLining?: number

      Smoke: extra forward-scattered light on thin edges when back-lit (silver lining).

    • Optionalsize?: number

      Base size (width), metres.

    • OptionalsizeRandom?: [number, number]

      Random size multiplier range.

    • Optionalsoftness?: number

      Soft depth fade against opaque geometry, metres (0 = hard).

    • Optionalsort?: boolean

      Back-to-front GPU sort (alpha blending).

    • Optionalstretch?: number

      Stretch along velocity: extra length = speed × stretch (seconds). 0 = camera-facing quads.

    seed?: string | number

    Seed for every per-particle random number (spawn position, velocity, size, life).