Closed aXu-AP closed 1 year ago
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.
Thanks for insight, good job!
Also, the compatibility renderer explicitly warns on the console that it does not support manually emitting the particles.
Oops, my bad, I'll remove this part from the issue.
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
You unbroke it! I guess that means this can be closed then? Might need still some testing as to what was the earlier behavior, wasn't CUSTOM not set at all?
CUSTOM always had lifetime in green and lifetime randomness in alpha.
The lifetime in Alpha seems to be the same as in Green, except that it's using the value in reverse and they are incrementing each other. There is no randomness to Alpha. Although, when CUSTOM is activated, the default particle randomness is disabled.
That is intended behaviour
Then we also need some documentation, since CUSTOM has no description of what each value does. For example, Red and Blue also seem to do nothing, so I couldn't test them.
You unbroke it!
Haha no i think emit_particle still needs to be fixed
Then we also need some documentation, since CUSTOM has no description of what each value does.
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
CUSTOM.x = angle (for billboard) CUSTOM.y = current lifetime CUSTOM.z = animation for flipbook CUSTOM.w = lifetime randomness
I moved the Red channel's values around, but didn't see any changes to the texture (the texture is already in Particle Billboard mode)
I also set "Particle Anim" and changed the Blue channel's value, but there were no changes in the animation. Even when I played around with the particle's animation settings, the blue value made no changes to them.
At this point, only the "current lifetime" is applying for CUSTOM. Although I wonder if it was supposed to be the inverse (like how Alpha is doing), with full green meaning full lifetime, as right now it seems counterintuitive.
Rotation, Scale and Color also seem to not be working.
@aXu-AP can you reproduce in beta2?
I tested the MRP and they behave exactly the same if i revert the big particle PR
I'm having a hard time debugging this issue. In the MRP I am observing the same behaviour when I revert the PR, so I'm wondering if I'm missing something somewhere.
To help me understand the issue and fix it faster, I need to have a clear idea of expected behaviour and current behaviour. Comparative videos of one and the other would also help a lot :pray:
I just tested with the Wagner's MRP, yes it is the same; however that MRP sends (0,0,0,1) as custom, my case was with (1,1,1,1). So change the exported custom
property to white. Which, according to your explanation is expected to be not working as green = lifetime. However, on 4.1 it works.
So, green = lifetime when it's used by the main particle system. If you script the shader yourself, it can mean anything.
Here's a new MRP. Sorry for not supplying one before: ParticleMRP.zip On 4.1, particles (white boxes) show, on 4.2 beta 2, nothing shows.
I think it makes sense that nothing shows. If your particles have already outlived their lifetime (green=1) then they should disappear. So if you spawn them, they spawn "already dead". This sounds like a bug in 4.1, if i understood correctly everything that's happening.
Yes, this is what I meant when I said that you unbroke it and this issue can be closed. The behavior is different, but earlier behavior was a bug and this was just me not knowing what parameters to set with emit_particle
. So user error essentially.
Alright then we agree :+1: Thanks everyone for taking the time to investigate this <3
Thank you for being patient 😅 Had I supplied an MRP straight away or at least tested the other MRP earlier to see that it differed from my case we could've solved this way faster.
No worries!
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?
@WagnerGFX Yeah I think we should track that as a separate documentation issue. If custom
parameter's behavior on standard processing paterial was documented properly, I would've used emit_particle
properly in first place 😁
I do think that emit particle probably can't be used together with a standard particle material in that way. the particle material has to override the custom data with its own calculated randomness inside. I don't think that can change so it should be documented both on emit particle and somewhere for the custom vector.
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 andCompatibilitybackends.Steps to reproduce
Create a GPUParticles2D and set up as normal. Add following script:
or GPUParticles3D
Minimal reproduction project
ParticleMRP.zip