added MIData at Material

This commit is contained in:
2023-05-09 22:03:02 +08:00
parent 3f1b8be5d0
commit 7c3d9ecf91
8 changed files with 153 additions and 49 deletions

View File

@@ -57,6 +57,16 @@ vec3 world_up;
float znear,zfar;)"
};
constexpr const ShaderBufferSource SBS_BoneInfo=
{
"BoneInfo",
"bone",
R"(
mat4 bone_mats[];
)"
};
namespace func
{
constexpr const char GetLocalToWorld[]=R"(
@@ -67,6 +77,16 @@ mat4 GetLocalToWorld()
LocalToWorld_2,
LocalToWorld_3);
}
)";
constexpr const char GetBoneMatrix[]=R"(
mat4 GetBoneMatrix()
{
return bone_mats[BoneID.x]*BoneWeight.x+
bone_mats[BoneID.y]*BoneWeight.y+
bone_mats[BoneID.z]*BoneWeight.z+
bone_mats[BoneID.w]*BoneWeight.w;
}
)";
}//namespace func
STD_MTL_NAMESPACE_END