Files
spellforge/shaders/bullet_glow.gdshader
T
2026-07-20 10:56:52 +08:00

13 lines
504 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 子弹发光圆:加法混合 + 软核 + 外发光(bullet-heaven 弹幕质感)
// 应用于 BulletManager 的 MultiMeshInstance2D(单位 QuadMeshUV 0-1
shader_type canvas_item;
render_mode blend_add;
void fragment() {
float d = length(UV - vec2(0.5)) * 2.0; // 0=中心 1=边缘
float core = smoothstep(1.0, 0.45, d); // 实心核
float glow = smoothstep(1.0, 0.0, d) * 0.5; // 外发光晕
float a = clamp(core + glow, 0.0, 1.0);
COLOR = vec4(COLOR.rgb, COLOR.a * a);
}