Fixing minor bugs
This commit is contained in:
parent
d8795ec076
commit
61665434ab
@ -298,7 +298,10 @@ void Character::drawGpuSkinning(Renderer& renderer) {
|
|||||||
|
|
||||||
if (anim.skinningMatrices.empty())
|
if (anim.skinningMatrices.empty())
|
||||||
{
|
{
|
||||||
return;
|
if (anim.model.animations.empty() || anim.model.animations[0].keyFrames.empty()) return;
|
||||||
|
anim.model.ComputeSkinningMatrices(
|
||||||
|
anim.model.animations[0].keyFrames[0].frame, anim.skinningMatrices);
|
||||||
|
if (anim.skinningMatrices.empty()) return;
|
||||||
}
|
}
|
||||||
static const std::string skinningShaderName = "skinning";
|
static const std::string skinningShaderName = "skinning";
|
||||||
static const std::string boneMatricesUniform = "uBoneMatrices[0]";
|
static const std::string boneMatricesUniform = "uBoneMatrices[0]";
|
||||||
@ -401,7 +404,12 @@ void Character::drawShadowDepthGpuSkinning(Renderer& renderer) {
|
|||||||
|
|
||||||
auto& anim = it->second;
|
auto& anim = it->second;
|
||||||
prepareGpuSkinningVBOs(anim);
|
prepareGpuSkinningVBOs(anim);
|
||||||
|
if (anim.skinningMatrices.empty()) {
|
||||||
|
if (anim.model.animations.empty() || anim.model.animations[0].keyFrames.empty()) return;
|
||||||
|
anim.model.ComputeSkinningMatrices(
|
||||||
|
anim.model.animations[0].keyFrames[0].frame, anim.skinningMatrices);
|
||||||
if (anim.skinningMatrices.empty()) return;
|
if (anim.skinningMatrices.empty()) return;
|
||||||
|
}
|
||||||
|
|
||||||
static const std::string shadowSkinningShader = "shadow_depth_skinning";
|
static const std::string shadowSkinningShader = "shadow_depth_skinning";
|
||||||
static const std::string boneMatricesUniform = "uBoneMatrices[0]";
|
static const std::string boneMatricesUniform = "uBoneMatrices[0]";
|
||||||
@ -506,7 +514,12 @@ void Character::drawGpuSkinningWithShadow(Renderer& renderer, const Eigen::Matri
|
|||||||
|
|
||||||
auto& anim = it->second;
|
auto& anim = it->second;
|
||||||
prepareGpuSkinningVBOs(anim);
|
prepareGpuSkinningVBOs(anim);
|
||||||
|
if (anim.skinningMatrices.empty()) {
|
||||||
|
if (anim.model.animations.empty() || anim.model.animations[0].keyFrames.empty()) return;
|
||||||
|
anim.model.ComputeSkinningMatrices(
|
||||||
|
anim.model.animations[0].keyFrames[0].frame, anim.skinningMatrices);
|
||||||
if (anim.skinningMatrices.empty()) return;
|
if (anim.skinningMatrices.empty()) return;
|
||||||
|
}
|
||||||
|
|
||||||
static const std::string skinningShadowShader = "skinning_shadow";
|
static const std::string skinningShadowShader = "skinning_shadow";
|
||||||
static const std::string boneMatricesUniform = "uBoneMatrices[0]";
|
static const std::string boneMatricesUniform = "uBoneMatrices[0]";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user