Skip to content

VfxComponents

15.10 Value struct

Class Documentation

Edit documentation

The component graph of a component emitter: one object per slot for lifetime, physics, rendering and geometry, an optional child component, and a list of extra components. A component emitter has almost no properties of its own. Everything that a complex emitter carries as properties - emission, lifetime, motion, material and primitive - comes from the components in these slots.

Required slots. When the system is prepared, the client builds the emitter only if LifetimeComponent, PhysicsComponent, RenderComponent and GeometryComponent are all set, and the geometry component resolves to a primitive. A graph that misses any of them drops its emitter without a message. ChildComponent and components are optional.

Preparing. The lifetime, physics and render components and every components entry reserve the random values and driver storage that their drivers need. The client loads the meshes that the geometry component's primitive names, the same way VfxMeshDefinitionData describes. The render component then builds the emitter's draw setup from the primitive, those meshes and the emitter's name.

Creating. When a system instance creates the emitter, every component creates its running part, an IVfxRuntime object, in this order: lifetime, physics, render, geometry, child, then the components entries in list order. Each running part declares the per-particle values that it stores.

Each update. In every substep of a system update, the component emitters update before the complex and simple emitters. For each component emitter the lifetime component first advances its state machine, see VfxLifetimeStateBehavior. Then the emitter runs one step:

  1. Particles die. A particle dies when its age reaches its lifetime. When the lifetime component reports that the emitter is finished, every particle dies.
  2. The lifetime component stores the step's time delta on every live particle.
  3. The render component starts its frame.
  4. If the lifetime component is still emitting and emission has not been stopped, it returns how many particles to spawn in this step, see VfxSpawnBehavior. The primitive can lower that count to its capacity. The new particles are spawned and every component is told about them.
  5. The lifetime component ages the particles.
  6. The physics, render, child and geometry components update, then every components entry in list order.
  7. The client sets the emitter's UV animation time: the time since the start delay ended, wrapped to the material's animation length. For an attached-mesh primitive it also stores the attachment transform.

A step with the same time as the previous step does nothing.

Stopping. When the particle system stops emitting, its component emitters spawn no more particles and their lifetime state machines move to the outro. The system counts as finished only when every component emitter is finished. When the system is destroyed, the running parts are deleted without a particle death hook for the particles that are still alive.

Shipped data. Component emitters ship in Summoner's Rift map data and in Global.wad.client. Every shipped graph fills the four required slots with VfxLifetimeComponent, VfxModularPhysicsComponent, VfxMaterialRenderComponent and VfxGeometryComponent, and leaves ChildComponent empty. Nearly every shipped component emitter sets disabled, and a disabled component emitter is never built.

Properties

components

List2<VfxComponentBase> = []
Type history (2 revisions)
Edit documentation

Extra components beyond the five named slots. Each entry reserves its driver storage when the system is prepared and creates its running part when the emitter is created. From then on it is told about each spawn and each particle death, and it updates after the five slots in every step.

Three component classes are made for this list:

Class Effect
VfxLightComponent A point light for the emitter.
VfxEffectorComponent An environment effector for the emitter.
VfxAudioComponent Sound events at spawn, at the start of emission or for the life of a particle.

Referenced by 1 class · 1 property