menu_bookDocumentation

Particle Effects: CPU-Simulated Programmable Particle System

calendar_today May 20, 2026 schedule ~1 min read person PatrickJr verified 50

The s&box particle system is CPU-simulated (multithreaded) and fully programmable via components. You can emit particles manually, iterate and modify them at runtime, write custom controllers, and react to collisions.

Architecture

A particle effect is built from multiple components on a GameObject:

ComponentRole
ParticleEffectBase effect. Holds particle list, ticks simulation. Configure max particles, lifetime, force, collision.
Renderer (e.g. ParticleSpriteRenderer)Renders particles. Sprite renderer draws camera-facing quads.
EmitterDefines spawn rate (burst or over time), shape, and start velocity. Optional if calling ParticleEffect.Emit manually.
ControllersCustom components that modify particles each frame (color over lifetime, size curves, etc.)

Manual Emission

You can skip built-in emitters and emit particles directly in code:

CSHARP
var effect = Components.Get<ParticleEffect>();
effect.Emit( new ParticleEffect.EmitParams
{
    Position = WorldPosition,
    Velocity = Vector3.Up * 100f
} );

Key Design Decisions

  • CPU simulation — enables full programmability and iteration over particles in C#
  • Multithreaded — performance scales with cores despite being CPU-based
  • Component-based — mix and match emitters, renderers, and controllers for flexibility
  • Collision support — particles can collide with the world (optional feature on ParticleEffect)

Custom Controllers

Write a component implementing particle controller logic to create custom behaviors (attract to point, follow spline, react to game state). See the Custom Particle Controller documentation for the interface details.

Was this helpful?