Big performance spike when first rendering VFXs

Hello,

For some reason I’m experiencing a big lag (~1/2 sec, up to 4 sec if debugging) when my VFX Graphs show for the first time in-game.
This is pretty weird and only happens the first time they are (seemingly) loaded into memory (I’m guessing GPU’s). I’m saying that because it doesn’t happen if I unload the scene and reload it again, only if I reboot the game (or editor).

Is anybody else experiencing this issue?

The graph is not particularly complicated, 11 nodes at most, much like the falling leaves VFX in the sample project in terms of complexity. And it only appears 3/4 times on screen. They are already present in the scene, nothing fancy just set to .enabled = false and then .enabled = true when they should start. I tried to change the culling flags but it didn’t change this issue, the lag spike just didn’t happen at the same moment, but would still occur.

Profiler for first render of the VFX:
Same run, second render of the VFX:

I’m using 2020.2.0b13 and HDRP 10.2

My ugly solution for now is to actually play the VFX with opacity 0 and activate it by changing it to 1. That way, the spike occurs at the very start and not in the middle of the gameplay session…

I tried changing the culling flags of the VFX, that did improve the issue quite a bit for VFX next to the starting point. Not for the ones that are further away (I guess culling is still applied even with the flag: “always compute bounds and simulate”).

Hi @FOXAcemond ,

If you’re still affected by these issues, it would be great if you could submit a bug report with a reproduction project attached.

Hello @LeonhardP

I later found out this problem disappears completely when I switched back to DirectX 11.
I’m currently planning in creating a reproducible for this issue. Have a lot on my plate for the end year.

Thank you, that would be much appreciated!

Is there any update on this issue? I’m experiencing a similar one

4 Likes

same here. most noticeable on mobile due to weaker hardware.
but happens only the very first time a specific vfx is instantiated, so i am going to manually warm up all vfx on game load (i am using single scene)