2021-02-24 10:58:31 +00:00
|
|
|
#version 450
|
2022-12-01 14:03:55 +00:00
|
|
|
#extension GL_GOOGLE_include_directive : enable
|
2023-01-23 02:14:06 +00:00
|
|
|
#extension GL_EXT_multiview : enable
|
|
|
|
|
2022-12-01 14:03:55 +00:00
|
|
|
#define OIT_SET 1
|
|
|
|
#include "oit_blend.finc"
|
2021-02-24 10:58:31 +00:00
|
|
|
|
2023-06-27 16:01:56 +00:00
|
|
|
layout (input_attachment_index = 0, set = 0, binding = 0) uniform subpassInput color;
|
|
|
|
layout (input_attachment_index = 1, set = 0, binding = 1) uniform subpassInput light;
|
|
|
|
layout (input_attachment_index = 2, set = 0, binding = 2) uniform subpassInput emission;
|
2021-02-24 10:58:31 +00:00
|
|
|
|
|
|
|
layout (location = 0) out vec4 frag_color;
|
|
|
|
|
|
|
|
void
|
|
|
|
main (void)
|
|
|
|
{
|
|
|
|
vec3 c;
|
2023-06-27 16:01:56 +00:00
|
|
|
vec3 l;
|
|
|
|
vec3 e;
|
|
|
|
vec3 o;
|
2021-02-24 10:58:31 +00:00
|
|
|
|
2023-06-27 16:01:56 +00:00
|
|
|
c = subpassLoad (color).rgb;
|
|
|
|
l = subpassLoad (light).rgb;
|
|
|
|
e = subpassLoad (emission).rgb;
|
|
|
|
o = BlendFrags (vec4 (c * l + e, 1)).xyz;
|
|
|
|
o = pow (o, vec3(0.83));//FIXME make gamma correction configurable
|
|
|
|
frag_color = vec4 (o, 1);
|
2021-02-24 10:58:31 +00:00
|
|
|
}
|