Skip to content

VFX Graph

Purpose

Captures Unity VFX Graph (VisualEffect) effects into frame sequences and sprite sheets for game-ready output. Uses deterministic VisualEffect.Simulate() stepping — the same primitive Unity's own VFX preview uses — so it works for any VFX asset, with no reliance on the old PlaybackTime exposed-property convention. Supports single-angle and multi-angle (directional) capture, alpha reconstruction, and a live in-editor preview with Unity's full VisualEffect inspector embedded.

A production Expert tab (alongside Particle FX). Baking flattens a 3D GPU effect into framed sprites, so the Particle FX suitability guidance applies here too: bursts, impacts, and target-anchored effects bake well; ambient volumetric loops do not.

Owns

  • VFXSimulator — the deterministic step/seek kernel (Reinit + Simulate(dt, steps) + pause, mirroring Unity's VFXViewController): SEEK re-simulates from zero in fixed sub-steps, ADVANCE steps forward preserving particle identity
  • The VFX Graph preview (VFXPlaybackPanel): SEEK scrub / STEP play with pause-after so the URP capture pump can't advance past the scrubbed time, prime-on-select
  • The VFX Graph export (VFXMultiAngleExportController + VFXExportOptionsPanel): warm-up + trim lead-in, single + multi-angle, looping (manual seamless-loop crossfade, automatic best-loop-point detection via the shared LoopPointDetector + LoopPointScorer, or a ping-pong bounce via the shared LoopPingPongProcessor), driven by the shared EditorBatchCaptureRunner — fully synchronous, no editor-coroutine dependency
  • The live parameter inspector (VFXParameterInspectorPanel): embeds Unity's own VisualEffect inspector via Editor.CreateEditor — every exposed property type, zero per-prefab setup
  • The Alpha Mode selector: None / Blended (straight-alpha reconstruction) / Additive (over-black luminance alpha — keeps glow punch without black boxes); default Blended, ~2× render cost when on

Does NOT Own

  • Built-in ParticleSystem capture (the sibling Features/ParticleFX territory)
  • The capture/composite/encode pipeline (consumes the shared CaptureRequest → StaticCaptureExecutor funnel, including the dual-background alpha reconstruction)
  • Frame-range math (ParticleCaptureRange in the unit-tested Logic kernel — shared with particles)
  • Sprite-sheet / GIF assembly (the Export feature)
  • GameReady trim / clip / prefab (it consumes this feature's Frame_###.png output)

Allowed Dependencies

VFX Graph may depend on:

  • Logic — shared pure kernels (ParticleCaptureRange, ParticleAlphaReconstruction)
  • The shared Capture pipeline (CaptureEngine, CaptureRequest, StaticCaptureExecutor) and EditorBatchCaptureRunner
  • Directional Capture (orientation presets), Export (sprite-sheet assembler)
  • Diagnostics (logging), UI styling helpers
  • UnityEngine.VFX (VisualEffect.Simulate, Reinit, pause) — optional: every file is guarded by the SNAP_SUPPORTS_VFX define, which DependencyChecker sets only when com.unity.visualeffectgraph is installed; without the package the tab shows an install nudge and SNAP compiles cleanly

Notes

  • Graphics API — Direct3D11 recommended. Heavy FX exports (dual-background alpha, multi-angle) render intensively; on some GPUs Unity's Direct3D12 backend can hang the device under that load. Put Direct3D11 first in Player Settings → Other Settings → Rendering → Graphics APIs for Windows and restart. The export panel shows an in-editor tip when D3D12 is detected.
  • Output is {prefab}_Frame_###.png (capital Frame_) so it feeds GameReady; multi-angle writes Angle_###/ subfolders.
  • Export folder pref is VfxExportPath — deliberately separate from the particle key (an earlier collision let VFX stomp the particle path).
  • Alpha Mode is per effect: Additive for glow/magic (preserves brightness-as-transparency), Blended for smoke/soft edges, None for opaque backgrounds. Auto is deliberately absent — VFX Graph output blending isn't introspectable the way particle materials are.
  • The grid shows a clickable "VFX" placeholder tile for VFX-only prefabs (no mesh to thumbnail); mixed prefabs get a real thumbnail.

Future Candidates

  • Fixed-seed determinism guard for exact multi-angle frame matching on stochastic effects.
  • Consider flipping the Alpha Mode default to Additive if usage shows it's the common reach.
  • A shared IFrameSimulator abstraction over VFXSimulator / ParticleSystemSimulator (the long-deferred particle "slice 5").