1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-27 22:41:56 +08:00
Files
Dog-Lynx-And-HCN/shaders/CooldownProgress.gdshader
T
fallingshrimp 234a632f39 refactor(UI): 调整技能图标布局并优化冷却效果
修改技能图标面板的锚点设置以改善布局
将冷却进度着色器逻辑反转并优化视觉效果
统一材质管理方式,移除重复的材质复制
2025-09-10 06:31:53 +08:00

19 lines
620 B
Plaintext

shader_type canvas_item;
uniform float progress:hint_range(-0.0, 2.0, 0.01)=0.5;
uniform float backAlpha:hint_range(0.0, 1.0, 0.01)=0.25;
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;
uniform float trailAlpha:hint_range(0.0, 1.0, 0.01)=0.5;
void fragment() {
if(UV.y>=1.0-progress){
if(1.0-progress+trailHeight-UV.y>0.0){
float dist=distance(UV.y,1.0-progress);
COLOR=vec4(1);
COLOR.a=(trailHeight-dist)/trailHeight*trailAlpha;
}else{
COLOR.a*=backAlpha;
}
}else if(distance(UV.y,1.0-progress)<edgeHeight){
COLOR=vec4(1.0);
}
}