Can someone help me?about Godot GPU particle System,How to make my shader custom parameter into a curved form that is controlled based on particle life duration?

Godot Version 4.6.3

How to make my shader custom parameter into a curved form that is controlled based on particle life duration? I can not find any custom data slot.
If I write a texture dissolve in my shader, and I want to be able to make that dissolve level go from 0 to 1 asymptotically over the life of the particle, there are a lot more custom parameters like that, but what annoys me is that I haven’t been able to find any way to do this at all.


uniform float dissolve_value : hint_range(0,1);

You can get the lifetime information from INSTANCE_CUSTOM in the vertex function

shader_type canvas_item;

uniform sampler2D dissolve_texture;

varying float lifetime;
void vertex() {
	lifetime = INSTANCE_CUSTOM.y;
}

void fragment() {
	float noise_sample = texture(dissolve_texture, UV).r;
	COLOR.a = min(COLOR.a, step(lifetime, noise_sample));
}

Thank you for your answer. This can only solve simple texture processing, but it’s hard to meet long-term needs. The current version seems to have removed the linkage function between custom data and parameters within shader. If I want to customize and open a parameter in shader to custom data to control parameters in process material, it becomes extremely difficult

I don’t understand, what is your custom data? Are you talking about uniforms? What is “the linkage function”?

I apologize for using translation software to reply to you, which may have caused unnecessary expression errors. custom data is the channel used by the particle system in unity to pass some parameters in the shader.

In unity there are two custom vectors open, and a total of 8 custom floats can be used to pass parameters in shaders and can turn them into curves, but in godot this doesn’t seem to be allowed? Or only 4 are open and the particle system itself still takes up 2 or 3?

I’m not sure what you mean by “turn them into curves” either; With the lifetime variable through INSTANCE_CUSTOM.y you can create a multitude of equations for a multitude of curves, you can use a uniform to declare extra data for the entire particle shader.

If you have an effect in mind could you share a video of it? Or a sample of the shader you are trying to replicate from Unity?