godot
godot copied to clipboard
[WIP] Tweak VisualShader for particles
Co-authored by: @hmans Salvage of #73037. Fixes #56358.
Differences to #73037 (subject to change):
- Change age and progress to use USERDATA2.xy instead of CUSTOM.yw (in case the user wants to access them inside the render shader, they need to be manually fed into CUSTOM)
Small demo (because why not):
@Geometror thanks for working on this, really great job so far! I have been playing around with it. and it seems to work as expected. The only part I was getting stuck on was trying to get rotations to align along the velocity direction.
I did manage to get it to work by using the process custom graph and the expression node. Basically just copied the existing shader code that does this. Of course this overwrites anything done in the standard start and process graphs using scaling. So I just did a hacky scale over progress thing in the expression.
Also added a collision box and graph to get a basic bounce happening, so it was good to see the collision normal parameter exposed. Not totally sure what collision depth does, but I guess it is how far inside the geometry it penetrates? Also noticed there is no collision custom graph, but maybe it is not needed, since it already has a transform socket.
I am guessing you have further plans outside of the scope of this PR for rotation options for aligning and aiming, etc without having to hack the custom graph? Not sure if custom is even needed if you can access the transforms in the standard process and start graphs?
Anyway, I will keep playing with it, as I haven't tried 2d particles yet. Hope you can get a code review on this to get it merged into 4.3!
Update on this: Geometror and I have discussed at length what to do with this PR, specifically because we'd like to take more time and properly design outputs before making particle process visual shaders actually usable. We don't want to find ourselves in the situation where we're forced to maintain outputs that don't make sense for most usecases. (rotation axis). This is an error on my part when i reviewed the addition in the past, I've grown to be more thoughtful and this is the last occasion we have to take a step back and properly design VS for particles with intention without breaking workflows. This is 4.4 material