@newkrok/three-particles - v2.16.1
    Preparing search index...

    Type Alias TrailConfig

    Configuration for the trail/ribbon renderer. Controls how particle trails are drawn when using RendererType.TRAIL.

    20
    
    constant 1.0
    
    linear fade from 1 (head) to 0 (tail)
    
    // Long comet-style trail tapering to nothing
    trail: {
    length: 40,
    widthOverTrail: {
    type: LifeTimeCurve.BEZIER,
    scale: 1,
    bezierPoints: [
    { x: 0, y: 1, percentage: 0 },
    { x: 0.5, y: 0.4 },
    { x: 1, y: 0, percentage: 1 },
    ],
    },
    }
    type TrailConfig = {
        colorOverTrail?: {
            b: LifetimeCurve;
            g: LifetimeCurve;
            isActive: boolean;
            r: LifetimeCurve;
        };
        length?: number;
        maxTime?: number;
        minVertexDistance?: number;
        opacityOverTrail?: LifetimeCurve;
        ribbonId?: number;
        smoothing?: boolean;
        smoothingSubdivisions?: number;
        twistPrevention?: boolean;
        width?: number;
        widthOverTrail?: LifetimeCurve;
    }
    Index

    Properties

    colorOverTrail?: {
        b: LifetimeCurve;
        g: LifetimeCurve;
        isActive: boolean;
        r: LifetimeCurve;
    }

    Per-channel color multiplier curves along the trail (head=0, tail=1). Works as multipliers on the particle's current color, same as colorOverLifetime. To achieve full color transitions, use white startColor.

    length?: number

    Number of position history samples per particle (trail segments). Higher values produce longer, smoother trails but cost more memory.

    maxTime?: number

    Maximum trail duration in seconds. Trail segments older than this value are faded out and expired, regardless of the ring-buffer length. This enables time-based trail length (e.g. "2-second trails") in addition to the segment-count cap.

    When 0 or undefined, trail length is governed only by length.

    0
    
    minVertexDistance?: number

    Minimum distance (in world units) a particle must travel before a new trail sample is recorded. When set, the trail becomes frame-rate independent — at high FPS the samples are spread further apart in time, at low FPS they cluster around sharp turns.

    When 0 or undefined, a sample is recorded every frame (legacy behavior).

    0
    
    opacityOverTrail?: LifetimeCurve

    Lifetime curve that controls opacity along the trail length.

    ribbonId?: number

    Connect multiple particles into a single continuous ribbon. All particles that share the same ribbonId are sorted by age and their positions are chained into one continuous strip.

    When undefined, each particle has its own independent trail (default behavior).

    smoothing?: boolean

    Enable Catmull-Rom spline interpolation between history samples. Inserts additional subdivided points between raw samples, eliminating sharp kinks at trail bends. The smoothingSubdivisions property controls how many extra points are inserted per segment.

    false
    
    smoothingSubdivisions?: number

    Number of Catmull-Rom subdivisions inserted between each pair of raw history samples when smoothing is enabled. Higher values produce smoother curves at the cost of more vertices.

    3
    
    twistPrevention?: boolean

    Enable twist prevention for the ribbon. Uses frame tracking to maintain consistent ribbon orientation during rapid direction changes, preventing self-intersecting or flipped ribbon quads.

    false
    
    width?: number

    Base ribbon width in world units.

    1.0
    
    widthOverTrail?: LifetimeCurve

    Lifetime curve that controls the ribbon width along its length. At 0 the trail head (current position), at 1 the trail tail (oldest position).