When new particles are displayed for the first time during gameplay, the game freezes briefly, likely due to loading. If the particles have already been displayed once, no loading occurs, but the current performance is very sluggish.
I initially thought this might be due to the heaviness of my own project, but the same issue occurs in the “Miegakure Smash” sample as well.
I am considering a solution where all particles scheduled to appear at the start of the scene are temporarily displayed off-screen to pre-load them. Are there any other better solutions?
Ideally, the loading process would become so lightweight that it would be imperceptible.
For reference, my PC specifications are as follows:
CPU: AMD Ryzen 7 9800X3D
GPU: NVIDIA GeForce RTX 5070 Ti
RAM: 32GB (16GB x 2)
Although I am using version 1.41, I have been struggling with this same problem for a while now.
This is probably Godot’s shader compile happening the first time a particle (or any new material) gets drawn. It only costs you once per particle type, which is why the second time is fine and why the sample does it too. Your hardware isn’t the issue.
Which renderer is your project on, Forward+ or Compatibility? That decides what works here. 1.4.1 is on Godot 4.7, and on Forward+ (or Mobile) the engine can precompile particle shaders ahead of time as long as the effect exists in the scene at least once, hidden or off screen is fine. So your off screen idea should be enough there. On Compatibility that precompile doesn’t exist, and the particle actually has to draw inside the view for at least one frame. In that case what I think I would try is emitting everything during the scene transition fade so they compile while the screen is still covered.
I’m going to look into making a preload system for this, either a custom action for one off preloads at the start of a scene or something more general that warms everything up front.
Thank you for your reply. I understand that this is the current specification.
Since the initial state is unchanged, it is likely using the Forward+ renderer. In any case, can we mitigate this by displaying all particles once every time the scene transitions?
However, since I am working on a project with frequent scene transitions, long load times during each transition would be quite challenging.
I look forward to the addition of a feature that allows all warm-up processes to be completed in advance.