quakeforge/libs/video/renderer/vulkan/shader/particle.frag
Bill Currie 00cade072c [vulkan] Implement order implement transparency
It's a bit flaky for particles, especially at higher frame rates, but
that's due to supporting only 64 overlapping pixels. A reasonable
solution is probably switching to a priority heap for the "sort" and
upping the limit.
2022-12-01 03:00:47 +09:00

22 lines
375 B
GLSL

#version 450
#extension GL_GOOGLE_include_directive : enable
#include "oit_store.finc"
layout (location = 0) in vec4 uv_tr;
layout (location = 1) in vec4 color;
layout(early_fragment_tests) in;
void
main (void)
{
vec4 c = color;
vec2 x = uv_tr.xy;
float a = 1 - dot (x, x);
if (a <= 0) {
discard;
}
c *= (a);
StoreFrag (c, gl_FragCoord.z);
}