← Pixel Dreamer Studio

Scale a 3D particle effect evenly

The node's scale reaches the whole effect only with local_coords and billboard_keep_scale on.

Scaling a GPUParticles3D node does not scale the whole effect. In our Godot 4.7 test, sparks on a node scaled to 2 flew about 4 times as high, 145 against 37 pixels on screen, and were no bigger. Turn on local_coords, so the gravity is scaled too, and billboard_keep_scale in the particle material, so each particle grows with the node. Then a scale of 2 gave twice the height, 73 pixels, and sparks twice as wide.

Two bursts of orange sparks. On the left, thin sparks shoot high and wide. On the right, thick sparks in a fountain
Godot 4.7 with the Compatibility renderer, frames from 0.1 to 1.3 seconds laid on top of each other, so you can see the path each spark took. Both nodes are scaled to 2. Left: only the scale, with local_coords and billboard_keep_scale off. Right: the script as written.

The code

Attach this to a GPUParticles3D and scale the node in the editor or from code, like any other node. The lines marked fix 1 and fix 2 are the change. The rest is an ordinary burst of sparks.

extends GPUParticles3D
## Sparks you can make bigger or smaller by scaling this node, like any other node.
## Two settings make the node's scale reach everything: the gravity and each particle's size.


func _ready() -> void:
	amount = 30
	lifetime = 1.6
	explosiveness = 1.0
	local_coords = true  # fix 1: the motion, gravity included, happens inside the node's scale
	var m := ParticleProcessMaterial.new()
	m.direction = Vector3.UP
	m.spread = 30.0
	m.initial_velocity_min = 3.0
	m.initial_velocity_max = 4.0
	m.gravity = Vector3(0, -6, 0)
	process_material = m
	var mat := StandardMaterial3D.new()
	mat.shading_mode = BaseMaterial3D.SHADING_MODE_UNSHADED
	mat.billboard_mode = BaseMaterial3D.BILLBOARD_PARTICLES
	mat.billboard_keep_scale = true  # fix 2: each particle grows and shrinks with the node
	mat.albedo_color = Color(1, 0.75, 0.3)
	var q := QuadMesh.new()
	q.size = Vector2(0.2, 0.2)
	q.material = mat
	draw_pass_1 = q

What we measured

One burst of 30 sparks from the same seed each time. We watched it for 1.5 seconds from 12 m away and recorded how high above the emitter the highest lit point got, and the most lit points in a single frame, which grows with the size of the sparks. Two runs of each.

Why the node's scale is not enough

With local_coords off, the particles live in world space, where the gravity is not scaled. The height fits sparks that start twice as fast under the same gravity: about 4 times as high instead of twice. A billboard material also drops the node's scale unless billboard_keep_scale is on, so the sparks stayed small. With local_coords off, turning on billboard_keep_scale alone did not help either: 330 lit points.

When the effect has to stay in world space

With local_coords on, particles already out move with the node. For smoke that should stay behind a moving object, leave it off and scale the effect by hand: double initial_velocity_min, initial_velocity_max, the gravity and the mesh size. That gave the same 73 pixels and 1,164 lit points as the script at scale 2. Change the max first: in our test, raising initial_velocity_min above the max raised the max with it.

More on local and world space: gravity on a rotated emitter.

What to change

Particles that should grow or shrink over their life: particle scale curve.

Tested in Godot 4.7 with the Compatibility renderer.

More how-tos: When particles do not show up