ULRE/ShaderLibrary/GetJointMatrix.glsl

12 lines
469 B
Plaintext
Raw Normal View History

2023-10-07 17:02:00 +08:00
mat4 GetJointMatrix()
{
// Joint数据分Joint ID和Joint Weight两部分
// Joint ID是一个uvec4在shader中为整数。在C++端可使用RGBA8UI或是RGBA16UI来传递。
// Joint Weight是权重在shader中为浮点。在C++端使用RGBA8或RGBA4来传递。
return joint.mats[JointID.x]*JointWeight.x+
joint.mats[JointID.y]*JointWeight.y+
joint.mats[JointID.z]*JointWeight.z+
joint.mats[JointID.w]*JointWeight.w;
}