From 5cd440b3a3b4a0625de72c1fdbfba2c92ae6b50e Mon Sep 17 00:00:00 2001 From: WormHeamer Date: Sat, 19 Jul 2025 17:40:20 -0400 Subject: particles! --- shader/tri.frag | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'shader/tri.frag') diff --git a/shader/tri.frag b/shader/tri.frag index dea0868..f67a4e0 100644 --- a/shader/tri.frag +++ b/shader/tri.frag @@ -1,9 +1,19 @@ #version 450 layout(location = 0) in vec2 uv; +layout(location = 1) in vec4 in_color; +layout(location = 2) flat in int type; + layout(location = 0) out vec4 out_color; void main(void) { float n = 2 * length(uv - 0.5); - out_color = vec4(vec3(uv, 1) * (1.75 - n), float(n<1)); + switch (type) { + case 0: + out_color = vec4(in_color.rgb, in_color.a * float(n<1)); + break; + case 1: + out_color = vec4(in_color.rgb, in_color.a * (max(0.25 - n, 0) + max(1 - n, 0)) * 0.5); + break; + } } -- cgit 1.4.1-2-gfad0