quakeforge/libs/video/renderer/vulkan/shader/compose.frag
Bill Currie 966ef949c5 [vulkan] Move oit blending into compose subpass
I had debated putting the blending in the compose subpass or a separate
pass but went with the separate pass originally, but it turns out that
removing the separate pass gains 1-3% (5-15/545 fps in a timedemo of
demo1).
2022-12-01 23:03:55 +09:00

20 lines
453 B
GLSL

#version 450
#extension GL_GOOGLE_include_directive : enable
#define OIT_SET 1
#include "oit_blend.finc"
layout (input_attachment_index = 0, set = 0, binding = 0) uniform subpassInput opaque;
layout (location = 0) out vec4 frag_color;
void
main (void)
{
vec3 o;
vec3 c;
o = subpassLoad (opaque).rgb;
c = BlendFrags (vec4 (o, 1)).xyz;
c = pow (c, vec3(0.83));//FIXME make gamma correction configurable
frag_color = vec4 (c, 1);
}