High GPU usage in editor even w/ VFX graphs not running + huge tris count, bug or normal behavior?

Hello people,

I’m on Unity 2022.3.16f1 using ECS and a single graph with multiple systems that handles every vfx in my scene. As always, I start by creating a standalone test graph with the new effect I want to implement, then when it’s ready, I merge it’s systems directly or as a subgraph in my main. I have quite a lof of vfx running each frames.
So, first question : Does the subgraphs have the same performances overhead as several “standalone” graphs ? Is my choice to go the single graph for every vfx way overkill ?

While working on a standalone test graph, I realized that the standalone and the main graphs are taking quite a lot of gpu usage in editor even when no vfx runs. I only have these 2 graphs right now.
I spent quite some time googling around but haven’t found much about that, I hope I did my searches right.

So I was working on some “mecanic” trails for 10k enemies and pushed the strip capacity to 500k to see how it looked (I started from the builtin Simple Head And Trail system). In play mode, it was using around 40, 45% stable of my gpu. When stopping play mode and looking at some other stuff, I noticed my gpu was going full blast at 100% in the task manager. But only when the window focus was on Unity, it happens both in the game view and the scene view, I don’t have both opened at the same time.

Disabling the visual effect graph layer visibility in the editor view doesn’t change anything. Manually stopping them with the vfx control box either. I added an event to manually play and stop them, no improvements. Updating to latest LTS (2022.3.19f1) didn’t changed anything either.
The only thing that allows the gpu to calm down is by disabling the gameobjects containing my graphs, it goes straight to 0, 1% then.
My main graph is taking around 30, 40% constantly by itself when the other graph is disabled.

For the standalone graph, I also noticed that the gpu usage in editor is directly correlated with the strip capacity setting. If I set it to 250k, it was chewing around 50% of the gpu, at 40k = around 15% and so on.
I also noticed a correlated huge bump in my tris count. I was around 500k tris before working on this graph, then was at 21M in editor with no vfx running/spawned and strip capacity set at 500k.
So, second question : Does this tris count means that all the strip trails are rendered all the time even when not spawned/running ?

I lowered strip capacity numbers to decent ones (10k) and it’s better, but it still eats some gpu usage when it shouldn’t as far as I understand how vfx graphs work.
And something else helped but I can’t understand why. Here’s how the two graphs were set in my hierarchy :

So it was on the parent gameobject of my main vfx graph. I set it there just out of lazyness for quick testing.
I then moved the standalone test graph to another gameobject like this :

This didn’t fixed anything at first, but after launching the play mode and tinkering with the strip capacity setting again, it seems that the problem just, disappeared ? It looks fixed in the scene view when the visual effect graph layer visibility is disabled. I’m now running at 1% gpu usage in editor even with strip capacity set to 500k with the vfx running and it’s visibility layer off.
The issue still happens in the gameview when the game isn’t running and it also still happens on my main graph in scene and game view no matter the visibility setting. I also tried moving my main graph to another gameobject but no luck. Am I missing something about how vfx graphs work in editor ?

Here’s how the standalone graph system look. There’s 3 of this system in this graph with only the “Add” node for the position changed a bit so my enemies can have 3 mecanic tentacules following their movements.

And for those wondering, here’s how it looks, heavily matrix inspired obviously :

Thanks for reading me. Please enlight me with your wisdom kind people :slight_smile:

edit 1 :
Ok I see that the scene view is getting updated unnecessarily even when nothing runs in the vfx graph. Here’s the profiler gpu usage when I activate the gameobject containing my main graph. Each systems in this vfx graph is triggered by a specific event in my code, so it shouldn’t run at all in editor.

And here’s the systems in my main vfx graph :

The view is cutted on the picture below but I just have 16 of the same system that takes care of the explosions. So I can have max 16 explosions happening in a single frame.

Hi! Sorry for the late reply:

  1. The concept of subgraph is editor only, the actual VFX will be compiled including what is in the subgraph. Therefore, performance should be the same, regardless of how you organize your asset.
    What can make a difference is to have one big graph or several smaller graphs (not subgraph). Having individual graphs will have some small overhead, but also can be culled individually. The choice will depend on your actual effect.
  2. I’m afraid, yes. This has been improved in 2023, with the support of indirect draw in strips. This was one of the reasons why strips were considered experimental.
  3. While an effect is being open in the editor, it is compiled in a special (not optimized) way to allow fast editing. Maybe this could be the reason? You have an option in the Compile menu to force Runtime mode even when the effect is open.

Hey, no problem, thanks a lot for taking the time.

  1. Nice, that was my assumption.
  2. Allright. So particle strips are the only effect that renders all the time ? Or does all the particles are always rendered even when not instantiated ?
  3. Well, the gpu and cpu usage are quite high even when the effect is not opened and when the editor isn’t in play mode. I tried the runtime mode but it doesn’t seem to change anything. So that means that all these strips are also rendering when I’m in edit mod and the gameobject that contains the visual effect graph is enabled ?

The gpu and cpu usage directly goes down to normal when the gameobject is disabled. Here’s a screenshot of the usage :

Ran into this same problem. I can definitively confim that particle strips are the issue here. Millions of verts being rendered when gameobjects with a visual effect with a trail on it is in the scene. Immediately goes back down to a normal number when deactivating that gameobject.

1 Like

Hello! can you tell me in what specific version this problem was fixed? we are on 2023.2.20f1 and I cant find any type of indirect draw or culling options in particle strips, resulting in this same performance problem, any help would be appreciated

This landed in 2023.3.0a10. More detail has been added in this post.