2023-07-02 10:58:56 +00:00
|
|
|
#version 450
|
2024-01-20 10:42:28 +00:00
|
|
|
#extension GL_GOOGLE_include_directive : enable
|
|
|
|
|
|
|
|
#include "fog.finc"
|
2023-07-02 10:58:56 +00:00
|
|
|
|
|
|
|
layout (set = 1, binding = 1) uniform sampler2DArray Texture;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
layout(early_fragment_tests) in;
|
|
|
|
|
|
|
|
layout (location = 0) out vec4 frag_color;
|
|
|
|
|
|
|
|
void
|
|
|
|
main (void)
|
|
|
|
{
|
|
|
|
vec4 pix;
|
|
|
|
|
|
|
|
pix = texture (Texture, vec3 (st, frame));
|
|
|
|
if (pix.a < 0.5) {
|
|
|
|
discard;
|
|
|
|
}
|
2024-01-20 10:42:28 +00:00
|
|
|
frag_color = FogBlend (pix, fog);
|
2023-07-02 10:58:56 +00:00
|
|
|
}
|