mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat: 添加激光子弹功能,更新相关资源和着色器
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
void fragment() {
|
||||
COLOR=vec4(vec2(textureSize(TEXTURE,0)),0,1);
|
||||
}
|
||||
Reference in New Issue
Block a user