Talos docs

particles

Since 0.6Changed in 0.7
Plain text

Use it in a scene entity's components list as { "type": "particles", … }. The contract writes the fields flat and refuses unknown keys.

Fields

FieldTypeRequiredDefaultAllowed valuesDescription
presetParticlePresetnosmoke, fire, sparks, dust, steam, drips, debris, glowOne of the eight built-in looks. Exactly one of preset and effect is required (particles-source). With a preset, rate is the particles per second.
ratenumbernoParticles per second of a preset. Ignored with an effect (the effect's own spawn rules apply).
colorstringno
materialstringnoA key of scene.assets whose kind is "material": a material file with a shader (blend: add or blend: blend) the sprites draw with instead of the built-in sprite. The shader reads particleAge, particleRandom and particleColor from its SurfaceInput. On HD such an emitter is simulated on the CPU so its shader can draw it; emitters without one stay GPU-simulated. Not supported together with effect yet (particles-source).
effectstringnoA particle effect (docs/VFX.md): a key of scene.assets whose kind is "effect" (a *.vfx.json file), a project-relative *.vfx.json path, "builtin:<preset>" (smoke, fire, sparks, dust, steam, drips, debris, glow) or "builtin:fx/<preset>" (sparks, flame, dust, puff-burst, hit, confetti, speed-lines; docs/VFX.md, Presets). Exactly one of preset and effect is required (particles-source). An unknown asset or built-in is vfx-effect-missing.
paramsobjectnoValues for the effect's declared params, by name: a number, [x, y, z], [r, g, b, a] or "#rrggbb[aa]", by the param's type. A name the effect does not declare, or a value of the wrong type, is ignored with a runtime warning. Only with an effect.

Rules that can refuse it

Example

From the contract's tested fixture fixtures/contract/full20/scene.json#smoke-vent.

{
  "type": "particles",
  "preset": "smoke",
  "rate": 24,
  "color": "#9AA0A6"
}