Vixen
02b45cc4
csharp
public record class VfxEffectContent

A particle effect as a build wrote it and a game loads it.

Read the guide page for this →

Remarks

The content form of VfxCompiledGraph, and the piece whose absence meant a game could not load a .vxvfx at all. The authored file is a node graph — nodes, edges, positions, the numbers somebody typed — which only the editor can read, and docs/overview.md listed it among the formats "whose compiler is still owed". This is what the compiler writes: the graph already reduced to the flat instruction list both backends run, with nothing of the editor in it.

Why the rows are mirrors rather than the runtime types annotated. VfxOperation and its siblings are positional record structs, and the serializer generator emits for a parameterless constructor and init members — so annotating them in place would mean rewriting types that every graph in every project constructs positionally. The mirror costs one row per runtime type and buys the runtime types keeping their shape. MaterialContent makes the same split for a different reason, and says so.

⚠ Attributes is not stored, and must not be. It is derived from what the operations read and write, and Compile derives it again on the way back in — so a stored copy is a second answer to a question with one answer, and the two would disagree the first time an opcode's declaration changed and an old asset was loaded by a new build. The same argument applies to every other derived fact here, of which that is the only one.

⚠ An invalid graph throws on the way back. Compile refuses an updater that reads an attribute nothing writes, and ToGraph goes through it rather than round it — so content the importer never produced fails loudly rather than running over zeroed memory, which is the failure mode with no symptom.

Fields and properties (9)

  • public const int Current

    The version this reader speaks.

  • public int Version

    Which version of the format this is.

  • public int Capacity

    How many particles one instance has room for.

  • public VfxSpawnerRow[] Spawners

    What makes particles.

  • public VfxOperationRow[] Initializers

    What a particle starts as.

  • public VfxOperationRow[] Updaters

    What happens to it, every step.

  • public VfxCustomAttributeRow[] Customs

    The attributes the graph declared for itself, in slot order.

  • public bool Drawn

    Whether anything draws it.

  • public VfxRendererRow Renderer

    How it is drawn, when Drawn says it is.

Methods (2)

Used by (7)

  • AssetVfxEffectSourceVixen.Engine.Renderer
  • EntryVixen.Engine.Renderer
  • TypeRegistrationVixen.Rendering
  • VfxEffectContentTestsVixen.Rendering.Tests
  • VfxEmitterVixen.Rendering
  • Vixen_Rendering_Vfx_VfxEffectContentSerializerVixen.Rendering
  • VfxImporterVixen.Editor.Assets