Spawn Over Distance is causing GC spikes

Hello,
Sorry for the late answer, we missed the initial message.
The block SpawnOverDistance relies on VFXSpawnerCallbacks interface, within the VisualEffectGraph package, there are a few blocks implemented this way :

For performance, when possible, we recommend avoiding usage of these spawn blocks for two reasons:

  • This unexpected garbage (which is actually an issue, you can track the resolution here)
  • These blocks are forcing the VisualEffect component update to be processed on the main thread (with current implementation of VFXSpawnerCallbacks)

However, the behavior of spawn over distance can generally be emulated using graph:
8442167--1119038--_SpawnOverDistance.gif

We are aware this VFX looks like a convoluted workaround but, even if the unexpected garbage is solved, the resolution of the performance issue with SpawnOverDistance will probably internally produce the same kind of graph.

8442167–1119026–SpawnOverDistance.unitypackage (12.6 KB)

1 Like