ADD: Particle system

This commit is contained in:
2025-12-17 22:17:32 +09:00
parent fa0298e4c1
commit 4fea967bfc
11 changed files with 1060 additions and 10 deletions

26
shaders/particles.frag Normal file
View File

@@ -0,0 +1,26 @@
#version 450
layout(location = 0) in vec4 v_color;
layout(location = 1) in vec2 v_uv;
layout(location = 0) out vec4 outColor;
void main()
{
// Soft circular sprite.
vec2 p = v_uv * 2.0 - 1.0;
float r = length(p);
float mask = smoothstep(1.0, 0.0, r);
vec4 c = v_color;
c.rgb *= mask;
c.a *= mask;
if (c.a <= 0.001)
{
discard;
}
outColor = c;
}