2022-05-04 05:07:27 +00:00
|
|
|
#version 450
|
|
|
|
|
2022-05-07 01:08:46 +00:00
|
|
|
layout (set = 1, binding = 0) uniform sampler2D Skin;
|
2022-05-04 05:07:27 +00:00
|
|
|
|
|
|
|
layout (push_constant) uniform PushConstants {
|
|
|
|
layout (offset = 68)
|
|
|
|
uint colorA;
|
|
|
|
uint colorB;
|
|
|
|
vec4 base_color;
|
|
|
|
vec4 fog;
|
|
|
|
};
|
|
|
|
|
|
|
|
layout (location = 0) in vec2 texcoord;
|
|
|
|
layout (location = 1) in vec4 position;
|
2022-05-07 04:00:02 +00:00
|
|
|
layout (location = 2) in vec3 fnormal;
|
|
|
|
layout (location = 3) in vec3 ftangent;
|
|
|
|
layout (location = 4) in vec3 fbitangent;
|
2022-05-07 01:08:46 +00:00
|
|
|
layout (location = 5) in vec4 color;
|
2022-05-04 05:07:27 +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 c;
|
|
|
|
vec4 e;
|
2022-05-07 01:08:46 +00:00
|
|
|
//vec3 n;
|
2022-05-04 05:07:27 +00:00
|
|
|
int i;
|
2022-05-07 04:00:02 +00:00
|
|
|
vec3 normal = normalize (fnormal);
|
|
|
|
vec3 tangent = normalize (ftangent);
|
|
|
|
vec3 bitangent = normalize (fbitangent);
|
2022-05-07 01:08:46 +00:00
|
|
|
//mat3 tbn = mat3 (tangent, bitangent, normal);
|
2022-05-04 05:07:27 +00:00
|
|
|
|
2022-05-07 01:08:46 +00:00
|
|
|
c = texture (Skin, texcoord);// * color;
|
|
|
|
//c = texture (Skin, vec3 (texcoord, 0)) * color;
|
|
|
|
//c += texture (Skin, vec3 (texcoord, 1)) * unpackUnorm4x8(colorA);
|
|
|
|
//c += texture (Skin, vec3 (texcoord, 2)) * unpackUnorm4x8(colorB);
|
|
|
|
//e = texture (Skin, vec3 (texcoord, 3));
|
|
|
|
//n = texture (Skin, vec3 (texcoord, 4)).xyz * 2 - 1;
|
2022-05-04 05:07:27 +00:00
|
|
|
|
|
|
|
frag_color = c;
|
2022-05-07 01:08:46 +00:00
|
|
|
frag_emission = vec4(0,0,0,1);//e;
|
|
|
|
frag_normal = vec4(normal,1);//vec4(tbn * n, 1);
|
2022-05-04 05:07:27 +00:00
|
|
|
frag_position = position;
|
|
|
|
}
|