2021-01-25 15:55:45 +00:00
|
|
|
#version 450
|
|
|
|
|
2023-07-02 10:58:56 +00:00
|
|
|
layout (set = 1, binding = 0) uniform sampler2D Palette;
|
|
|
|
layout (set = 2, binding = 0) uniform sampler2DArray Skin;
|
2021-01-28 06:20:24 +00:00
|
|
|
|
2021-01-25 15:55:45 +00:00
|
|
|
layout (push_constant) uniform PushConstants {
|
2021-02-02 10:53:36 +00:00
|
|
|
layout (offset = 68)
|
2023-07-02 10:58:56 +00:00
|
|
|
uint colors;
|
|
|
|
vec4 base_color;
|
2021-01-25 15:55:45 +00:00
|
|
|
vec4 fog;
|
|
|
|
};
|
|
|
|
|
|
|
|
layout (location = 0) in vec2 st;
|
2023-07-02 10:58:56 +00:00
|
|
|
layout (location = 1) in vec4 position;
|
2021-01-25 15:55:45 +00:00
|
|
|
layout (location = 2) in vec3 normal;
|
|
|
|
|
|
|
|
layout (location = 0) out vec4 frag_color;
|
|
|
|
|
|
|
|
void
|
|
|
|
main (void)
|
|
|
|
{
|
2023-07-02 10:58:56 +00:00
|
|
|
vec4 c = texture (Skin, vec3 (st, 0)) * base_color;
|
|
|
|
vec4 e = texture (Skin, vec3 (st, 1));
|
|
|
|
vec4 rows = unpackUnorm4x8(colors);
|
|
|
|
vec4 cmap = texture (Skin, vec3 (st, 2));
|
|
|
|
c += texture (Palette, vec2 (cmap.x, rows.x)) * cmap.y;
|
|
|
|
c += texture (Palette, vec2 (cmap.z, rows.y)) * cmap.w;
|
|
|
|
|
|
|
|
frag_color = c + e;//fogBlend (c);
|
2021-01-25 15:55:45 +00:00
|
|
|
}
|