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;
|
2026-01-24 09:20:19 +08:00
|
|
|
uniform float edgeHeight:hint_range(0.0, 1.0, 0.01)=0.06;
|
2025-09-10 22:08:57 +08:00
|
|
|
uniform vec4 edgeColor:source_color;
|
2026-01-24 09:20:19 +08:00
|
|
|
uniform float trailHeight:hint_range(0.0, 1.0, 0.01)=0.4;
|
2025-09-06 14:52:42 +08:00
|
|
|
void fragment() {
|
2025-09-10 06:31:53 +08:00
|
|
|
if(UV.y>=1.0-progress){
|
2026-01-24 09:20:19 +08:00
|
|
|
if(distance(UV,vec2(0.5,0.5))>0.5-edgeHeight){
|
|
|
|
|
COLOR=vec4(1,1,1,1);
|
|
|
|
|
}else if(1.0-progress+trailHeight-UV.y>0.0){
|
|
|
|
|
float dist=UV.y-(1.0-progress);
|
|
|
|
|
COLOR=vec4(1,1,1,(trailHeight-dist)/trailHeight*0.8);
|
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
|
|
|
}
|
|
|
|
|
}
|