2025-09-06 14:52:42 +08:00
|
|
|
shader_type canvas_item;
|
2025-09-09 22:26:16 +08:00
|
|
|
uniform float progress:hint_range(-0.0, 2.0, 0.01)=0.5;
|
2025-09-10 22:08:57 +08:00
|
|
|
uniform float backAlpha:hint_range(0.0, 1.0, 0.01)=0.1;
|
2025-09-06 16:40:25 +08:00
|
|
|
uniform float edgeHeight:hint_range(0.0, 1.0, 0.01)=0.05;
|
2025-09-10 22:08:57 +08:00
|
|
|
uniform vec4 edgeColor:source_color;
|
2025-09-06 16:40:25 +08:00
|
|
|
uniform float trailHeight:hint_range(0.0, 1.0, 0.01)=0.3;
|
2025-09-10 22:08:57 +08:00
|
|
|
uniform vec4 trailColor:source_color;
|
2025-09-06 14:52:42 +08:00
|
|
|
void fragment() {
|
2025-09-10 06:31:53 +08:00
|
|
|
if(UV.y>=1.0-progress){
|
|
|
|
|
if(1.0-progress+trailHeight-UV.y>0.0){
|
|
|
|
|
float dist=distance(UV.y,1.0-progress);
|
2025-09-10 22:08:57 +08:00
|
|
|
COLOR=mix(COLOR,trailColor*vec4(1,1,1,(trailHeight-dist)/trailHeight),1);
|
2025-09-10 06:31:53 +08:00
|
|
|
}else{
|
|
|
|
|
COLOR.a*=backAlpha;
|
|
|
|
|
}
|
|
|
|
|
}else if(distance(UV.y,1.0-progress)<edgeHeight){
|
2025-09-10 22:08:57 +08:00
|
|
|
COLOR=edgeColor;
|
2025-09-06 14:52:42 +08:00
|
|
|
}
|
|
|
|
|
}
|