Godot decides whether to draw a GPUParticles3D from its visibility_aabb, a box around the node, not from where the particles are. The default box is 8 m wide, 4 m each way from the emitter. In our Godot 4.7 test, fireworks launched from the ground rose about 26 m. Looking at the base, they were drawn. Looking up at the burst, with the base below the screen, 0 pixels: the box was off screen, so the whole effect was skipped while every spark was in view. The script below watches one lifetime with capture_aabb(), merges the boxes and sets visibility_aabb: 912 to 1,053 lit pixels looking up.
The code
Save it as vis_box.gd and load it with const VisBox := preload("res://vis_box.gd"). In the emitter's _ready(), await VisBox.fit($Fireworks). It restarts the effect and watches it for one lifetime, so do it before the player sees it, or once while you build the scene: print the box it returns and type it into visibility_aabb in the Inspector, so the game never has to wait.
extends RefCounted
## Fit a GPUParticles3D's visibility box to where its particles really go, so the effect
## is not culled while its particles are still on screen (fireworks, tall fire, wide explosions).
## const VisBox := preload("res://vis_box.gd")
## func _ready():
## await VisBox.fit($Fireworks) # watches one lifetime, then sets visibility_aabb
## Better still: run it once, print the box and paste it into visibility_aabb in the Inspector.
static func fit(p: GPUParticles3D, margin := 1.0) -> AABB:
var was_emitting := p.emitting
p.restart() # one full lifetime from the start, one-shot effects too
var box := AABB()
var found := false
var watch_ms := int(p.lifetime * 1000.0 / maxf(p.speed_scale, 0.01)) + 100
var end := Time.get_ticks_msec() + watch_ms
while Time.get_ticks_msec() < end:
await p.get_tree().process_frame
var b := p.capture_aabb() # where the particles are this frame, in the node's space
if b.size == Vector3.ZERO:
continue
box = b if not found else box.merge(b)
found = true
if found:
p.visibility_aabb = box.grow(margin)
p.emitting = was_emitting
return p.visibility_aabb
What we measured
A GPUParticles3D on the ground shooting 200 white sparks up at 12 to 14 m/s, 25 degree spread, light gravity, 2.5 s life. We counted the lit pixels on the rendered screen with the camera looking at the base, then looking up at the top of the fireworks with the base out of view. The sparks are random, so the counts differ a little between our two runs; the zeros were the same in both.
- Default box, position (-4, -4, -4), size (8, 8, 8): 1,032 to 1,065 lit pixels looking at the base, 0 looking up.
- The script: it watched for 2.6 s and set a box of about 27 by 28 by 23 to 28 m, starting 1.2 m below the emitter. Then 918 to 1,012 looking at the base and 912 to 1,053 looking up.
- A second, identical emitter elsewhere, default box: 0 looking up. The script's box typed in by hand: 875 to 938.
Why it happens
Before drawing, Godot skips everything whose box is outside the camera's view, which saves the work of drawing what cannot be seen. For a mesh the box comes from the mesh. Particles are simulated on the graphics card, so Godot cannot know in advance where they will go, and uses the fixed box you give it. Fireworks, tall fire, rain over a whole area or a wide explosion leave the default 8 m box quickly, and the effect disappears as soon as the box leaves the screen, even when the camera only turns a little.
What to change
- A box that is too big only costs drawing the effect when it is off screen, so a little extra is fine. The script adds 1 m on every side.
- Effects that should go when far away: hide particles far from the camera. Fireworks that burst by themselves: fireworks without sub-emitters.
Ready-made fireworks: Festival & Fireworks VFX for Godot 4 has rockets that burst by themselves, Peony, Willow Gold, Ring Cyan and more, plus fountains and sparklers.
Tested in Godot 4.7 with the Compatibility renderer.
Ready-made: Festival & Fireworks VFX for Godot 4 has rockets that burst by themselves, Peony, Willow Gold, Ring Cyan and more, plus fountains and sparklers.
More how-tos for Festival & Fireworks VFX for Godot 4: Fireworks without sub-emitters · Confetti particles with random colors · Random directions spread evenly over a sphere or a cone
More how-tos: When particles do not show up
- Stop flipbook particles from vanishing at the end of their life
- GPUParticles3D not showing in Godot 4
- GPUParticles2D not showing in Godot 4
- GPUParticles2D collision: fall through or vanish
- Particles look black or dark
- 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
- Transparent PNGs without a dark outline
- Scale a 3D particle effect evenly
- Particles the same size on screen at any distance