mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-25 04:52:29 +08:00
feat: 添加VerticalSoften着色器,增强透明度控制逻辑
This commit is contained in:
@@ -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));
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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){
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
void fragment() {
|
||||
COLOR=vec4(vec2(textureSize(TEXTURE,0)),0,1);
|
||||
}
|
||||
Reference in New Issue
Block a user