2021-12-14 05:44:16 +00:00
|
|
|
#version 450
|
|
|
|
|
2021-12-14 16:22:05 +00:00
|
|
|
layout (set = 1, binding = 1) uniform sampler2DArray Texture;
|
2021-12-14 05:44:16 +00:00
|
|
|
|
|
|
|
layout (push_constant) uniform PushConstants {
|
|
|
|
layout (offset = 64)
|
|
|
|
int frame;
|
|
|
|
int spriteind;
|
|
|
|
// two slots
|
|
|
|
vec4 fog;
|
|
|
|
};
|
|
|
|
|
|
|
|
layout (location = 0) in vec2 st;
|
|
|
|
layout (location = 1) in vec4 position;
|
|
|
|
layout (location = 2) in vec3 normal;
|
|
|
|
|
2022-12-23 03:47:28 +00:00
|
|
|
layout(early_fragment_tests) in;
|
|
|
|
|
2021-12-14 05:44:16 +00:00
|
|
|
layout (location = 0) out vec4 frag_color;
|
|
|
|
layout (location = 1) out vec4 frag_emission;
|
|
|
|
layout (location = 2) out vec4 frag_normal;
|
|
|
|
layout (location = 3) out vec4 frag_position;
|
|
|
|
|
|
|
|
void
|
|
|
|
main (void)
|
|
|
|
{
|
|
|
|
vec4 pix;
|
|
|
|
|
2021-12-14 16:22:05 +00:00
|
|
|
pix = texture (Texture, vec3 (st, frame));
|
2021-12-14 05:44:16 +00:00
|
|
|
if (pix.a < 0.5) {
|
|
|
|
discard;
|
|
|
|
}
|
|
|
|
frag_color = vec4(0,0,0,1);
|
|
|
|
frag_emission = pix;
|
|
|
|
frag_normal = vec4(normal, 1);
|
|
|
|
frag_position = position;
|
|
|
|
}
|