API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classAlphaFadeOverLifetime
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.
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.
new(curve: Curve): AlphaFadeOverLifetime 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 curve: Curve