mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-21 19:57:44 +00:00
This is big, as it shows we are now correctly parsing the havok XML sidecard data and you can edit the scale of the bones in the viewport. This also pulls in a new libxiv version, which is required to fill out the used bones list on a Model. Right now the bone editing is incredibly basic, and the viewport suffers from a lack of depth testing still.
34 lines
1,013 B
GLSL
34 lines
1,013 B
GLSL
#version 450
|
|
|
|
layout(location = 0) in vec3 inPosition;
|
|
layout(location = 1) in vec3 inNormal;
|
|
layout(location = 2) in vec4 inBoneWeights;
|
|
layout(location = 3) in uvec4 inBoneIds;
|
|
|
|
layout(location = 0) out vec3 outNormal;
|
|
layout(location = 1) out vec3 outFragPos;
|
|
|
|
layout(push_constant) uniform PushConstant {
|
|
mat4 vp, model;
|
|
int boneOffset;
|
|
};
|
|
|
|
layout(std430, binding = 2) buffer readonly BoneInformation {
|
|
mat4 bones[128];
|
|
};
|
|
|
|
void main() {
|
|
mat4 BoneTransform = bones[boneOffset + inBoneIds[0]] * inBoneWeights[0];
|
|
BoneTransform += bones[boneOffset + inBoneIds[1]] * inBoneWeights[1];
|
|
BoneTransform += bones[boneOffset + inBoneIds[2]] * inBoneWeights[2];
|
|
BoneTransform += bones[boneOffset + inBoneIds[3]] * inBoneWeights[3];
|
|
|
|
BoneTransform = model * BoneTransform;
|
|
|
|
vec4 bPos = BoneTransform * vec4(inPosition, 1.0);
|
|
vec4 bNor = BoneTransform * vec4(inNormal, 0.0);
|
|
|
|
gl_Position = vp * bPos;
|
|
outNormal = bNor.xyz;
|
|
outFragPos = vec3(model * vec4(inPosition, 1.0));
|
|
}
|