#VFX graph particle pooling

1 messages · Page 1 of 1 (latest)

silent meteor
#

When it comes to pooling particles in the VFX graph, I'm usually using a manager type script with events to spawn these particles at specific coordinates. This method of spawning would only require a single VFX graph component and asset to accomplish which works quite well.

Now, when dealing with particles that rely on a GameObject's transform values and its locality, I've opted to attach a system component and asset to each GameObject. With this approach, I'm seeking confirmation on whether referencing similar VFX assets through multiple systems would enable some form of pooling optimization shared among these systems for when assigning a large capacity of particles.

If the current behavior aligns with this question, I am curious about the idea of implementing an additional system/asset in the scene (hidden from view) and allocating a substantial capacity to each of my VFX assets, mimicking general GameObject pooling behavior.

eager geode
#

Hi Mao!

#

From 2022.2 we introduced VFX instancing. This means that VFX components sharing the same VFX asset will be batched together. Resulting in allocation happening per batch and being reused when possible and Dispatch and Drawcalls count being reduced when possible (going from component granularity to batch granularity). So in a way, there's already some pooling involved under the hood.

#

Instancing can be configured per asset (and opt-out per component). In the VFX asset inspector you can choose whether to enable instancing and also possibly specifying a manual batch size (or let the VFX system to decide on its own).

#

You can also take a look at this nice talk by Gabriel that goes deeper into VFX instancing https://www.youtube.com/watch?v=HTLA1tEvTKA&list=PLX2vGYjWbI0TkxPwhWgsBhvj-EwxJDt5x

Real-time VFX are often performance intensive, especially as your game scales. In this session, you will see how VFX Graph works, in particular the new instancing feature that enables you to create many instances of your VFX in an efficient way. Using practical examples, you will learn how to identify issues and potential bottlenecks, as well as...

▶ Play video