← Pixel Dreamer Studio

Ambient particles in many places from one emitter

Emission points for the spots, and a visibility box that covers all of them.

Use one GPUParticles3D with the emission shape set to Points and a texture that holds every spot, and set its visibility_aabb to cover all of them. In our Godot 4.7 test, 100 emitters of 8 particles took 100 draw calls. One emitter of 800 particles from the same 100 spots took 1 and drew about as many lit pixels. Without its visibility box it drew nothing: the default box is 8 m around the node, and the node was off screen.

The code

Add a GPUParticles3D, give it a ParticleProcessMaterial and a draw pass as usual, and attach this script. Then add Marker3D children wherever the effect should be: in sunbeams, over a swamp, along a path. The script reads them once in _ready().

extends GPUParticles3D
## One emitter for ambient particles in many places at once: dust in sunbeams, pollen, embers, fireflies.
## Give it your process_material (a ParticleProcessMaterial) and draw pass as usual, then add Marker3D children where the effect should be.
## It emits from every marker, and it is one draw call however many markers there are.

@export var margin := 2.0  ## how far particles drift from their marker, in metres


func _ready() -> void:
	var pts: Array[Vector3] = []
	for c in get_children():
		if c is Marker3D:
			pts.append(c.position)
	if pts.is_empty():
		return
	var img := Image.create(pts.size(), 1, false, Image.FORMAT_RGBF)
	for i in pts.size():
		img.set_pixel(i, 0, Color(pts[i].x, pts[i].y, pts[i].z))  # one pixel per marker = its position
	var m := (process_material as ParticleProcessMaterial).duplicate() as ParticleProcessMaterial
	m.emission_shape = ParticleProcessMaterial.EMISSION_SHAPE_POINTS
	m.emission_point_texture = ImageTexture.create_from_image(img)
	m.emission_point_count = pts.size()
	process_material = m
	# the default box is 8 m around this node: without this, looking away from the node hides every particle
	var box := AABB(pts[0], Vector3.ZERO)
	for p in pts:
		box = box.expand(p)
	visibility_aabb = box.grow(margin)

What we measured

100 spots on a grid, 2 m apart, 20 to 38 m from the node. The camera looked at the spots, not at the node. Draw calls from the renderer's monitor, lit pixels averaged over 10 frames, two runs.

Why the single emitter disappears

Godot decides whether to draw an emitter from its visibility_aabb, a box around the node, not from where the particles really are. Emission points far from the node put the particles outside that box, and when the box is off screen the whole emitter is skipped. Setting the box from the spots, plus a margin for how far the particles drift, fixes it.

What to change

Painting the spots instead of placing markers: VFX Painter Kit for Godot 4 lets you brush ambient particles onto your level in the editor (click and drag, Shift to erase, Undo). Each layer is one GPUParticles3D, one draw call. 12 presets: fireflies, dust motes, ground mist, falling leaves, magic sparkles, embers, snowfall, bubbles, pollen, steam vents, holy motes and drips.

Tested in Godot 4.7 with the Compatibility renderer.

Ready-made: VFX Painter Kit for Godot 4 lets you paint ambient particles onto your level in the editor, with each layer as one emitter and one draw call, and 12 presets from fireflies to ground mist.

More how-tos for VFX Painter Kit for Godot 4: Place brush dots at the same spacing however fast the mouse moves · Nodes your editor tool adds that stay in the scene

More how-tos: Auras, rings, beams and weather