Renderer · const

PARTICLE_MOTE_FRAG

Dust motes and drifting glints: unlit, alpha blended, and fogged only when the caller asks.

Explained in Hello world.

const PARTICLE_MOTE_FRAG: string
import { PARTICLE_MOTE_FRAG } from '@driftengine/core';

In depth

What neither existing material could draw. 'spark' is unlit but additive — its fragment stage folds its whole brightness into colour and always writes alpha 1, because additive blending is rgb * a and a real alpha there would double the energy (the note at the end of PARTICLE_SPARK_FRAG explains why). 'smoke' has a real, varying alpha, but pays for it with lighting it can never turn off. A point that is unlit and genuinely translucent — what three.js's PointsMaterial draws, and what drei's Sparkles is built on — was not expressible by either.

No noise, no core-and-halo split: a mote is not a body being eroded and it is not incandescent, so borrowing either shape would draw the wrong material behind the right blend state. This is the plainest fragment stage in the file on purpose — a soft round point whose colour is nothing but its own vColor and whose opacity is nothing but its own vAlpha.

Fog is the one thing this material still asks the caller about. A mote is the one particle a scene legitimately wants both ways: dust caught in a shaft of light recedes into haze exactly like anything else out there, but a field of them meant to read as flat, close atmosphere — the look this exists for — must not. 'spark' and 'smoke' take no such option and stay unconditionally fogged, matching every particle drawn before this material existed; see ParticleBatchOptions.fog.