godot: emit_particle doesn't work (GPUParticles2D and 3D)
Godot version
v4.2.beta1.official [b1371806a]
System information
Windows 10 / NVIDIA Geforce GTX 1060 3GB / all backends
Issue description
GPUParticles2D/3D emit_particle
doesn’t do anything in the 4.2 beta 1. In the last snapshot it worked fine. Tested in Forward+, Mobile and Compatibility backends.
Steps to reproduce
Create a GPUParticles2D and set up as normal. Add following script:
extends GPUParticles2D
func _process(delta: float) -> void:
emit_particle(global_transform, Vector2.ZERO, Color.WHITE, Color.WHITE, 0b11111)
or GPUParticles3D
extends GPUParticles3D
func _process(delta: float) -> void:
emit_particle(global_transform, Vector3.ZERO, Color.WHITE, Color.WHITE, 0b11111)
Minimal reproduction project
About this issue
- Original URL
- State: closed
- Created 9 months ago
- Comments: 20 (16 by maintainers)
So, about the Rotation, Scale, Color, CUSTOM Red/Blue/Alpha and CUSTOM documentation? Do they deserve issues of their own to look into that later?
I’ve made a little reproduction project to test the issue in 2D and 3D. It works directly on the editor and exposes the emission settings to test the issue.
From the tests, I’ve found out that the CUSTOM color’s Alpha and Green channels are being used for the particle’s lifetime.
I’m not completely sure on how emit_particle() works, but from more testing, I’ve also found that it doesn’t seem to be applying Rotation, Scale or Color. This behavior is the same in Godot 4.1.2-stable.
Also, the compatibility renderer explicitly warns on the console that it does not support manually emitting the particles.
GPUParticle Emit.zip
Haha no i think emit_particle still needs to be fixed
Yeah fair!
CUSTOM.x = angle (for billboard) CUSTOM.y = current lifetime CUSTOM.z = animation for flipbook CUSTOM.w = lifetime randomness
actual lifetime (in 0-1 value) is INSTANCE_CUSTOM.y/INSTANCE_CUSTOM.w
I’m not so sure either how my PR broke it, but of note CUSTOM always had lifetime in green and lifetime randomness in alpha. That is intended behaviour, unless there’s some strange interaction now that wasn’t there before