Enable culling for animated mesh

Use the first frame bounding box for it, don't update each frame
This commit is contained in:
Benau 2016-12-11 11:01:02 +08:00
parent fcd1e2830e
commit ceef7495d2
2 changed files with 2 additions and 6 deletions

View File

@ -1166,7 +1166,7 @@ void CSkinnedMesh::finalize()
void CSkinnedMesh::updateBoundingBox(void)
{
if(!SkinningBuffers)
if(HardwareSkinning || !SkinningBuffers)
return;
core::array<SSkinMeshBuffer*> & buffer = *SkinningBuffers;

View File

@ -361,11 +361,7 @@ scene::ISceneNode* KartModel::attachModel(bool animated_models, bool always_anim
node = irr_driver->addAnimatedMesh(m_mesh, "kartmesh",
NULL/*parent*/, getRenderInfo());
// as animated mesh are not cheap to render use frustum box culling
if (CVS->isGLSL())
node->setAutomaticCulling(scene::EAC_OFF);
else
node->setAutomaticCulling(scene::EAC_FRUSTUM_BOX);
node->setAutomaticCulling(scene::EAC_FRUSTUM_BOX);
#endif
if (always_animated)
{