API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classAlphaFadeOverLifetime

@codexo/exojs-particles / particles / stable

Fades only the alpha channel over a particle's lifetime, leaving RGB untouched. Pair with a spawn-time tint or a separate `ColorOverLifetime` to keep the color layer stable while controlling opacity from a single curve. The default curve `1 → 0` produces a linear fade-out. For a fade-in then fade-out, pass a curve like `[0,0]→[0.5,1]→[1,0]`. GPU-eligible: uploads the curve as a 256-tap 1D R32F texture; alpha is resampled per-particle in the compute shader and stitched into the existing color word with a single mask + shift.

1
props
5
methods
0
events
Import
import { AlphaFadeOverLifetime } from '@codexo/exojs-particles'

Fades only the alpha channel over a particle's lifetime, leaving RGB untouched. Pair with a spawn-time tint or a separate `ColorOverLifetime` to keep the color layer stable while controlling opacity from a single curve.

The default curve `1 → 0` produces a linear fade-out. For a fade-in then fade-out, pass a curve like `[0,0]→[0.5,1]→[1,0]`.

GPU-eligible: uploads the curve as a 256-tap 1D R32F texture; alpha is resampled per-particle in the compute shader and stitched into the existing color word with a single mask + shift.

Constructors 1
new(curve: Curve): AlphaFadeOverLifetime
Methods 5
apply(system: ParticleSystem, _dt: number): void
destroy(): void
uploadTextures(device: GPUDevice, textures: ReadonlyMap<string, GPUTexture>): void
wgsl(): WgslContribution
writeUniforms(view: DataView, byteOffset: number, dt: number): void
Properties 1
curve: Curve
Source