Renderer · interface

DeviceParticles

Particles a caller's own compute shader wrote into a buffer of its own (registerCompute), drawn where they lie by drawDeviceParticles rather than read back and uploaded again. WebGPU only.

Explained in Hello world.

interface DeviceParticles
import type { DeviceParticles } from '@driftengine/core';

In depth

Not sorted, as a pool's are where its batch asks: the device holds them, so an alpha-blended set that must be drawn far to near sorts itself. A slot with a half-width of 0 draws nothing, which is how a fixed-size buffer holds fewer live particles than it has room for.

Properties

NameTypeDescription
bufferreadonlyGPUBufferA buffer with VERTEX usage, DEVICE_PARTICLE_FLOATS floats a particle.
countreadonlynumberHow many particles from its start to draw; no more than the buffer holds.