Hello everyone, I apologize that this is my first time making a 2D game. Since I want my game to run smoothly on older machines, I always ask myself when I add a new feature: are you doing this efficiently?
Recently, I wanted to add some weather effects to my game, such as rain and snow. At first, I added a new canvas layer to accomplish this, but the snow was "following" the camera, which looked very strange.
So if I want snowflakes to fall like in reality, I have to make a large particle "box" that covers the whole map? Will this cause performance issues? Or is "GPUParticles" only drawing the visible part, so I'm overthinking it?

  • All particles will be processed, not only those on the screen. Those not on screen might be culled from being drawn, but it might still have an impact.

    If you are worried about performance, it might be best to split the particles into chunks, maybe roughly screen-sized. So instead of having one box that covers the whole map, you would have many smaller boxes. Then, you can enable them based on proximity to the player (by manually checking the distance or by using an Area2D node).

All particles will be processed, not only those on the screen. Those not on screen might be culled from being drawn, but it might still have an impact.

If you are worried about performance, it might be best to split the particles into chunks, maybe roughly screen-sized. So instead of having one box that covers the whole map, you would have many smaller boxes. Then, you can enable them based on proximity to the player (by manually checking the distance or by using an Area2D node).

You could maybe use a parallax effect to have them move opposite the camera while drawing on their own canvas. Just move them by the negative of the cameras position, and when one goes far enough off screen, recycle it to the other side

    award Thanks bro, your suggestion sounds the same in principle as above, but I'm sorry I can only choose one best answer.