I’ve been playing around with VFX Graph a lot recently, and I really love the toolset. However, I keep running into performance issues both in the editor workflow and in play-mode.
The most recent and most unpleasant is that it takes almost 30 seconds to do some fundamental operations. I’ve got a vfx graph containing four instances of another subgraph which is a small particle system. I’m using this to quickly mirror my effects across the x and z axes. When I try to open the subgraph, or save a change to the main graph, it sometimes takes about 30 seconds, saying “Application.UpdateScene” in the popup progress bar.
Having more than about four Visual Effect components running in a scene absolutely wrecks my frame rate.
So my question is this: what is a good way to make a visual effect that needs to occur repeatedly (like a muzzle flash, firework, or spaceship thruster flame)? And are there any established best practices I should use when working with VFX Graph?
Can’t help you with the first one, but I have some observations to the second one:
First - separate graph instances are not batched in any way from what I know, so if you add 100 identical graphs they act as 100 different graphs.
Second - update cost of 5 graphs is higher than update cost of one graph with 5 systems, still it matters only if you have many of them, like at least 20-50+
Third - there was a bug recently where you paid full cost of rendering (changing shader), even if graph produced 0 particles and it’s fixed, but not in all versions, you might run old one or without fix.
Fourth - are you sure vfx is the direct cause of the problem? Are you on mobile?
4 graphs should not be so heavy - you made very performence heavy graphs or something else is your bottleneck.
What is good practice to deal with these things you ask (like muzzle flash)? Currently the best solution would be to have one master VFX graph for all effects on your scene. You can use textures or buffers to send multiple spawn data to vfx, something like this: https://discussions.unity.com/t/781944
One note - you need to create big bounds or update them, otherwise your effects will not be visible.
i5-2500 3.3Ghz, AMD R9 Series 290, Unity 2021.2.15f1, URP
My GPU utilization is 80/90% as soon as I add an empty Visual Effect Component into my scene. There is no VFX graph referenced in the component and it still happens.
Is this normal? Nothing else in Unity editor behaves like this for me. My System is old but have no problems with anything else.
Such behavior is indeed unexpected. I’ve tried reproducing it on the older machine (with GTX 960), but couldn’t notice anything like this.
Could you please raise a bug on this with steps of reproduction and your machine specifics included? You can do so in Unity via Menu bar > Help > Report a Bug. I’d be also grateful, if you jotted down the case number here in the thread.