2025-09-06 14:52:42 +08:00
|
|
|
shader_type canvas_item;
|
2025-09-06 16:40:25 +08:00
|
|
|
uniform float progress:hint_range(0.0, 2.0, 0.01)=0.5;
|
2025-09-06 15:04:32 +08:00
|
|
|
uniform float backAlpha:hint_range(0.0, 1.0, 0.01)=0.25;
|
2025-09-06 16:40:25 +08:00
|
|
|
uniform float edgeHeight:hint_range(0.0, 1.0, 0.01)=0.05;
|
|
|
|
|
uniform float trailHeight:hint_range(0.0, 1.0, 0.01)=0.3;
|
2025-09-06 14:52:42 +08:00
|
|
|
void fragment() {
|
|
|
|
|
COLOR=texture(TEXTURE,UV);
|
|
|
|
|
if(UV.y>=progress){
|
2025-09-06 15:04:32 +08:00
|
|
|
COLOR.a*=backAlpha;
|
2025-09-06 16:40:25 +08:00
|
|
|
}else if(distance(UV.y,progress)<edgeHeight){
|
|
|
|
|
COLOR.rgb*=255.0;
|
|
|
|
|
}else if(progress-UV.y<=trailHeight){
|
|
|
|
|
COLOR.rgb*=1.0+(trailHeight/(progress-UV.y)-1.0)*0.5;
|
2025-09-06 14:52:42 +08:00
|
|
|
}
|
|
|
|
|
}
|