public sealed class VfxSystemOne running instance of a compiled graph: its particles, its clock, and its seed.
Remarks
The graph is the effect and this is the effect happening. A graph is shared between every instance of it — the same array of operations, read and never written — and everything that differs between two campfires is here: how far through they are, what their seeds are, and the particles themselves.
Two instances with the same seed and the same steps are identical. Not similar: identical, particle for particle, because nothing in the simulation reads a clock, a thread identifier, or anything else the caller did not hand it. That is what makes an effect reproducible in a replay and testable against a golden image, and it is the reason VfxRandom is stateless.
Time is accumulated, not integrated. A rate spawner keeps its fractional debt across steps, so 2.5 particles a second at sixty hertz emits five particles every two seconds rather than none at all — which is what dropping the fraction would do, and what makes a low-rate emitter mysteriously silent.
Fields and properties (16)
public VfxCompiledGraph GraphThe graph being run.
public uint SeedThe instance's seed.
public Vector3 OriginWhere the emitter is. Added to every position an initializer writes.
public ParticleBuffer ParticlesIts particles.
public float TimeHow long it has been running, in seconds.
public int CountHow many particles are alive.
public bool EmittingWhether the spawners are running. Particles already alive keep going either way.
public int LastSpawnedHow many particles the last Step spawned.
public int FirstSpawnedWhere the particles the last Step spawned begin.
public bool RecordDeathsWhether to remember where particles died, for a sub-emitter to use.
public int LastDiedHow many particles died in the last Step.
public ReadOnlySpan<Vector3> DeathsWhere they were when they died, when RecordDeaths is on.
public JobScheduler? SchedulerWhere the sweeps run, or null to run them on the calling thread.
public int ParallelThresholdHow many particles it takes before Scheduler is used at all.
public bool LastStepWasParallelWhether the last Step ran its sweeps across threads.
public int LastRefusedHow many the last Step could not spawn because the buffer was full.
Methods (4)
public VfxSystem(VfxCompiledGraph graph, uint seed = 1)Starts an instance of a graph.
public void Step(float deltaTime)Advances the effect.
public void Reset()Kills every particle and puts the clock back to zero.
public void Dispose()Frees the particle storage.
Used by (21)
- SweepBenchmarksVixen.Benchmarks.Vfx
- ParticleLightTestsVixen.Rendering.Tests
- ParticleLightsVixen.Rendering
- ParticleRenderFeatureVixen.Rendering
- ParticleRenderFeatureTestsVixen.Rendering.Tests
- ParticleSpriteDeviceTestsVixen.Graphics.Golden.Tests
- VfxCustomAttributeTestsVixen.Vfx.Tests
- VfxExtractionSystemVixen.Rendering
- VfxExtractionTestsVixen.Rendering.Tests
- VfxForceTestsVixen.Vfx.Tests
- VfxGeometryBuilderVixen.Vfx
- VfxGeometryTestsVixen.Vfx.Tests
- VfxParallelTestsVixen.Vfx.Tests
- VfxRibbonTestsVixen.Vfx.Tests
- VfxSubEmitterVixen.Vfx
- VfxSubEmitterTestsVixen.Vfx.Tests
- VfxSystemTestsVixen.Vfx.Tests
- AuthoringTestsVixen.Editor.AssetEditors.Tests
- VfxDocumentVixen.Editor.AssetEditors
- VfxGraphCompilerTestsVixen.Editor.VfxGraph.Tests
- VfxPreviewViewVixen.Editor.AssetEditors