2021-02-17 04:35:19 +00:00
|
|
|
#version 450
|
2021-12-06 11:38:06 +00:00
|
|
|
|
2021-12-17 03:20:32 +00:00
|
|
|
layout (set = 1, binding = 0) uniform sampler2DArray Skin;
|
2021-02-17 04:35:19 +00:00
|
|
|
|
|
|
|
layout (push_constant) uniform PushConstants {
|
|
|
|
layout (offset = 68)
|
|
|
|
uint colorA;
|
|
|
|
uint colorB;
|
2021-12-08 15:25:50 +00:00
|
|
|
vec4 base_color;
|
2021-02-17 04:35:19 +00:00
|
|
|
vec4 fog;
|
|
|
|
};
|
|
|
|
|
|
|
|
layout (location = 0) in vec2 st;
|
2021-02-25 04:46:33 +00:00
|
|
|
layout (location = 1) in vec4 position;
|
2021-02-17 04:35:19 +00:00
|
|
|
layout (location = 2) in vec3 normal;
|
|
|
|
|
|
|
|
layout (location = 0) out vec4 frag_color;
|
2021-03-22 10:08:16 +00:00
|
|
|
layout (location = 1) out vec4 frag_emission;
|
|
|
|
layout (location = 2) out vec4 frag_normal;
|
|
|
|
layout (location = 3) out vec4 frag_position;
|
2021-02-17 04:35:19 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
main (void)
|
|
|
|
{
|
|
|
|
vec4 c;
|
2021-03-22 10:08:16 +00:00
|
|
|
vec4 e;
|
2021-02-17 04:35:19 +00:00
|
|
|
int i;
|
|
|
|
vec3 light = vec3 (0);
|
2021-12-17 03:20:32 +00:00
|
|
|
c = texture (Skin, vec3 (st, 0)) * base_color;
|
|
|
|
c += texture (Skin, vec3 (st, 1)) * unpackUnorm4x8(colorA);
|
|
|
|
c += texture (Skin, vec3 (st, 2)) * unpackUnorm4x8(colorB);
|
|
|
|
e = texture (Skin, vec3 (st, 3));
|
2021-02-17 04:35:19 +00:00
|
|
|
|
|
|
|
frag_color = c;
|
2021-03-22 10:08:16 +00:00
|
|
|
frag_emission = e;
|
2022-05-05 14:46:24 +00:00
|
|
|
frag_normal = vec4(normalize(normal), 1);
|
2021-02-25 04:46:33 +00:00
|
|
|
frag_position = position;
|
2021-02-17 04:35:19 +00:00
|
|
|
}
|