1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-27 22:41:56 +08:00

feat: 添加VerticalSoften着色器,增强透明度控制逻辑

This commit is contained in:
2025-09-06 20:41:48 +08:00
parent d04b364d5d
commit 0f3dc2ca9f
11 changed files with 19 additions and 100 deletions
@@ -2,8 +2,7 @@
[ext_resource type="Script" path="res://scripts/Statemachine/FullscreenPanelBase.gd" id="1_8e8nf"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mjt0u"]
bg_color = Color(0, 0, 0, 0.5)
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_grmsd"]
[sub_resource type="Animation" id="Animation_76r7u"]
length = 0.001
@@ -53,7 +52,7 @@ tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"handle_modes": PackedInt32Array(0, 0),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0, 500, -0.25, 0, 0.25, 0),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0, 100, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0, 0.5)
}
@@ -107,7 +106,11 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_mjt0u")
theme_override_styles/panel = SubResource("StyleBoxEmpty_grmsd")
[node name="background" type="ColorRect" parent="content"]
layout_mode = 2
color = Color(0, 0, 0, 0.5)
[node name="wrapper" type="VBoxContainer" parent="content"]
layout_mode = 2
+1 -1
View File
@@ -100,7 +100,7 @@ stretch_mode = 5
[node name="beachball" type="Label" parent="container/info/infos/beachballInfo"]
unique_name_in_owner = true
layout_mode = 2
text = "100"
text = "500"
[node name="name" parent="container/info" instance=ExtResource("3_qv0b1")]
unique_name_in_owner = true
@@ -8,7 +8,7 @@
[node name="MakeFeed" instance=ExtResource("1_1wmro")]
script = ExtResource("2_pr610")
[node name="wrapper" parent="content" index="0"]
[node name="wrapper" parent="content" index="1"]
theme_override_constants/separation = 50
[node name="tips" type="VBoxContainer" parent="content/wrapper" index="0"]
-1
View File
@@ -20,6 +20,5 @@ void fragment() {
wave_intensity *= sin(wave_dist * wave_frequency * 3.14159) * wave_amplitude;
vec3 base_color = mix(vec3(1.0), laser_color.rgb, 1.0 - laser_intensity);
vec3 color = base_color + vec3(wave_intensity);
//COLOR = vec4(color, (0.5-x_dist)/0.5);
COLOR = vec4(color,smoothstep(0,1.0-edge_nonalpha,(0.5-x_dist)/0.5));
}
-31
View File
@@ -1,31 +0,0 @@
shader_type canvas_item;
uniform float explosion_radius : hint_range(0.0, 1.0) = 0.0;
uniform float explosion_intensity : hint_range(0.0, 2.0) = 1.0;
uniform vec4 explosion_color : source_color = vec4(1.0, 0.5, 0.0, 1.0);
uniform float time_scale = 1.0;
void fragment() {
// 计算当前像素到中心的距离
vec2 center = vec2(0.5, 0.5);
float dist = distance(UV, center);
// 使用TIME创建随时间变化的爆炸效果
float time = TIME * time_scale;
float explosion = smoothstep(explosion_radius, explosion_radius - 0.2, dist) * explosion_intensity;
// 添加一些噪声使爆炸看起来更自然
float noise = sin(dist * 20.0 - time * 5.0) * 0.1;
explosion += noise;
// 计算最终颜色,混合原始纹理和爆炸效果
vec4 original_color = texture(TEXTURE, UV);
vec4 final_color = mix(original_color, explosion_color, explosion);
// 添加一些发光效果
float glow = exp(-dist * 5.0) * explosion_intensity;
final_color.rgb += glow * explosion_color.rgb;
final_color.a;
// 输出最终颜色
COLOR = final_color;
}
-1
View File
@@ -4,7 +4,6 @@ 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;
void fragment() {
COLOR=texture(TEXTURE,UV);
if(UV.y>=progress){
COLOR.a*=backAlpha;
}else if(distance(UV.y,progress)<edgeHeight){
-37
View File
@@ -1,37 +0,0 @@
shader_type canvas_item;
uniform float explosion_radius : hint_range(0.0, 1.0) = 0.0;
uniform float explosion_intensity : hint_range(0.0, 2.0) = 1.0;
uniform vec4 explosion_color : source_color = vec4(1.0, 0.5, 0.0, 1.0);
uniform float time_scale = 1.0;
void fragment() {
// 计算当前像素到中心的距离
vec2 center = vec2(0.5, 0.5);
float dist = distance(UV, center);
// 使用TIME创建随时间变化的爆炸效果
float time = TIME * time_scale;
float explosion = smoothstep(explosion_radius, explosion_radius - 0.2, dist) * explosion_intensity;
// 添加一些噪声使爆炸看起来更自然
float noise = sin(dist * 20.0 - time * 5.0) * 0.5 + 0.5;
explosion *= noise;
// 限制explosion值在0-1范围内
explosion = clamp(explosion, 0.0, 1.0);
// 计算最终颜色,混合原始纹理和爆炸效果
vec4 original_color = texture(TEXTURE, UV);
vec4 final_color = mix(original_color, explosion_color, explosion);
// 添加一些发光效果
float glow = exp(-dist * 5.0) * explosion_intensity;
final_color.rgb += glow * explosion_color.rgb;
// 确保alpha通道正确设置
final_color.a = max(original_color.a, explosion);
// 输出最终颜色
COLOR = final_color;
}
-12
View File
@@ -1,12 +0,0 @@
shader_type canvas_item;
uniform vec4 color: source_color;
uniform float laser_width: hint_range(0.01, 1.0) = 0;
uniform float soft_edge: hint_range(0.0, 0.5) = 0.5;
void fragment() {
float dist = abs(UV.x - 0.5);
float core = 1.0 - smoothstep(0.0, laser_width, dist);
float edge = 1.0 - smoothstep(laser_width, laser_width + soft_edge, dist);
float alpha = max(core, edge);
COLOR = color;
COLOR.a = alpha;
}
-7
View File
@@ -1,7 +0,0 @@
shader_type canvas_item;
uniform int pixelSize;
void fragment() {
vec2 uv = UV - mod(UV, vec2(float(pixelSize)) / vec2(textureSize(TEXTURE, 0)));
COLOR = texture(TEXTURE, uv);
}
+10
View File
@@ -0,0 +1,10 @@
shader_type canvas_item;
uniform vec2 percent=vec2(0,1);
void fragment(){
COLOR=vec4(0,0,0,1);
if(UV.y<percent.x){
COLOR.a*=UV.y/percent.x;
}else if(UV.y>percent.y){
COLOR.a*=1.0-(distance(UV.y,percent.y))/(1.0-percent.y);
}
}
-5
View File
@@ -1,5 +0,0 @@
shader_type canvas_item;
void fragment() {
COLOR=vec4(vec2(textureSize(TEXTURE,0)),0,1);
}