quakeforge/libs/video/renderer/vulkan/shader/particle.frag
Bill Currie 778ffadd54 [vulkan] Implement fog for the forward renderer
Other than decoupled lightmap support, I think that has the vulkan
forward renderer feature complete (though a little buggy with its
lightmap updates and fisheye gets validation errors).
2024-01-20 19:45:45 +09:00

32 lines
556 B
GLSL

#version 450
#extension GL_GOOGLE_include_directive : enable
#extension GL_EXT_multiview : enable
#include "fog.finc"
#include "oit_store.finc"
layout (push_constant) uniform PushConstants {
layout (offset = 64)
vec4 fog;
};
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 = c * a;
c = FogBlend (c * a, fog);
StoreFrag (c, gl_FragCoord.z);
}