A new StandardMaterial3D has shading_mode on Per-Pixel, so the scene's lights decide how bright each particle is. In a dark scene, or with the sun behind the particles, they turned black in our test, because the side of a particle you see faces the camera, away from that light. For sparks, fire and magic, set shading_mode to Unshaded (Shading, Shading Mode in the Inspector): the particles then show exactly the color you set.

The code
Attach this to a GPUParticles3D for a fountain of light blue sparks. The shading_mode line is the fix.
extends GPUParticles3D
## Magic sparks that keep their color in a dark scene, or with the sun behind them.
## A new StandardMaterial3D is lit by the lights in the scene. Unshaded ignores them.
func _ready() -> void:
amount = 30
lifetime = 1.5
var m := ParticleProcessMaterial.new()
m.direction = Vector3.UP
m.spread = 30.0
m.initial_velocity_min = 0.8
m.initial_velocity_max = 1.4
m.gravity = Vector3(0, -0.5, 0)
process_material = m
var mat := StandardMaterial3D.new()
mat.shading_mode = BaseMaterial3D.SHADING_MODE_UNSHADED # the fix: the color you set is the color you see
mat.billboard_mode = BaseMaterial3D.BILLBOARD_PARTICLES
mat.albedo_color = Color(0.4, 0.8, 1.0)
var q := QuadMesh.new()
q.size = Vector2(0.1, 0.1)
q.material = mat
draw_pass_1 = q
What we measured
One particle that does not move, in the middle of the screen, set to the color 0.40/0.80/1.00 (red/green/blue from 0 to 1). We read the color in the middle of it, with a sun light in different places. Two runs gave the same numbers.
- Unshaded, the script: 0.40/0.80/1.00 with no light, with the sun behind the particle and with a sky-blue background. Always the color we set.
- Per-Pixel, no light, dark background: 0.00/0.01/0.05. Black.
- Per-Pixel, sun behind the particle: 0.00/0.01/0.05, the same black.
- Per-Pixel, sun from the camera's side: 0.38/0.75/0.93, close to the color we set.
- Per-Pixel, sun behind, sky-blue background: 0.12/0.35/0.60. The light from the background kept it from black, but it was dull and dark.
- A new StandardMaterial3D had
shading_modeon Per-Pixel.
Smoke that should take the light
Smoke and dust look better lit by the scene, so Unshaded is not always what you want. Keep Per-Pixel and turn on backlight_enabled with a backlight color: light from behind then comes through the particle. With the sun behind and backlight at 0.6 grey, the particle read 0.31/0.64/0.80 instead of black. It works in the Compatibility renderer too.
What to change
albedo_color: the color of the sparks. With Unshaded, this is exactly what you see.q.size,amountand the velocities: the size of the sparks and the fountain.
Sparks that also glow: glowing particles. Particles that do not show at all: GPUParticles3D not showing. Soft smoke on the ground: soft particles with Proximity Fade.
Tested in Godot 4.7 with the Compatibility renderer.
More how-tos: When particles do not show up
- GPUParticles3D not showing in Godot 4
- GPUParticles2D not showing in Godot 4
- GPUParticles2D collision: fall through or vanish
- Particles only fall down or fly sideways
- Particles not working in a web export
- Particles fall through the floor
- Particles on terrain and uneven ground
- Flipbook animation on GPUParticles3D
- GPUParticles2D sprite sheet not animating
- Pixel art particles look blurry
- Particle trails in the Compatibility renderer
- GPUParticles2D trails not working
- Particle color over lifetime not working
- Particle texture shows a square box
- Custom particle shader ignores the color ramp
- Particle scale curve not working
- Additive particles invisible on a white background
- Scale a 3D particle effect evenly
- Particles the same size on screen at any distance