Repository: godot
Issue: GPUParticles2D not visible when exporting a game with `--headless`
Labels: bug,topic:rendering,confirmed,topic:export,topic:particles

### Godot version

4.0.1stable, master (2a275b9)

### System information

Linux archlinux 6.1.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Tue, 24 Jan 2023 21:07:04 +0000 x86_64 GNU/Linux

### Issue description

Particle systems are not showing when exporting a game on Linux. This might be related to #75270. However, some particles are showing, and some are not. But: It does not depend on the platform. It happens for all linuxbsd, windows and the web target. I'm not seeing errors, the particle systems are just not showing.

## What I have tried

- Checked if texture import settings are different for the different particle systems. They are not.
- Created a test scene with all permutations of texture import settings in order to check which one might be the issue (fix alpha border, premult alpha, ... etc.). No success! Either all or none of them show up, depending or how I build the game (see below).
- ...
- Checked if the images used on the textures are different. Of course the files contain different images, but their format is the same:

```bash
fd ".*particle.*png$" | xargs file
scenes/map_event_node/map_event_node_particle.png:          PNG image data, 512 x 512, 8-bit/color RGBA, non-interlaced
scenes/player/player_thruster_particle.png:                 PNG image data, 512 x 512, 8-bit/color RGBA, non-interlaced
tests/particle_systems/test_particle_both.png:              PNG image data, 512 x 512, 8-bit/color RGBA, non-interlaced
tests/particle_systems/test_particle_fix_alpha_border.png:  PNG image data, 512 x 512, 8-bit/color RGBA, non-interlaced
tests/particle_systems/test_particle_nothing.png:           PNG image data, 512 x 512, 8-bit/color RGBA, non-interlaced
tests/particle_systems/test_particle_premultiply_alpha.png: PNG image data, 512 x 512, 8-bit/color RGBA, non-interlaced
```




### Steps to reproduce

## Building a game with missing particle systems

Export the game using the Godot versions specified. Some particle systems show up and others aren't. I haven't been able to track down the root cause, since I simply don't know about Godot internals. However, I can confirm that it happens when I:

- Build the game without removing the `.godot` directory beforehand
- When I build the game using the commandline and the `--headless` option

However, I have been able to consistently create builds where all particle systems are showing up.

## Building a game with all particle systems

This is what I have to do:

1. Remove the `.godot` folder
2. Launch the godot editor at least twice
3. Export using the godot editor or export using the cli but without `--headless`

`1.` requires `2.` -- Otherwise the game is not exported at all.
And `3.` is needed to consistently produce builds that contain all particle systems.

### Minimal reproduction project

I have created a minimal reproduction project. However, the problem does not occur there. I have updated my game to use the very same settings as the minimal project (every rendering setting was identical), however the problem persisted.

Please let me know if you need any other information.
Thanks!