mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-25 06:15:36 +00:00
Merge pull request #2083 from Azaezel/loopyLODs
Sanity check to ensure detail levels shift in tandem for skinned meshes
This commit is contained in:
commit
6db2f2f5bf
2 changed files with 6 additions and 6 deletions
|
|
@ -811,7 +811,7 @@ void TSShapeInstance::MeshObjectInstance::render( S32 objectDetail,
|
||||||
// skin is dirty and needs to be updated. This should result
|
// skin is dirty and needs to be updated. This should result
|
||||||
// in the skin only updating once per frame in most cases.
|
// in the skin only updating once per frame in most cases.
|
||||||
const U32 currTime = Sim::getCurrentTime();
|
const U32 currTime = Sim::getCurrentTime();
|
||||||
bool isSkinDirty = currTime != mLastTime;
|
bool isSkinDirty = (currTime != mLastTime) || (objectDetail != mLastObjectDetail);
|
||||||
|
|
||||||
// Update active transform list for bones for GPU skinning
|
// Update active transform list for bones for GPU skinning
|
||||||
if ( mesh->getMeshType() == TSMesh::SkinMeshType )
|
if ( mesh->getMeshType() == TSMesh::SkinMeshType )
|
||||||
|
|
@ -832,7 +832,7 @@ void TSShapeInstance::MeshObjectInstance::render( S32 objectDetail,
|
||||||
|
|
||||||
// Update the last render time.
|
// Update the last render time.
|
||||||
mLastTime = currTime;
|
mLastTime = currTime;
|
||||||
|
mLastObjectDetail = objectDetail;
|
||||||
GFX->popWorldMatrix();
|
GFX->popWorldMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -863,9 +863,9 @@ bool TSShapeInstance::MeshObjectInstance::bufferNeedsUpdate( S32 objectDetail )
|
||||||
return mesh && mesh->getMeshType() == TSMesh::SkinMeshType && currTime != mLastTime;
|
return mesh && mesh->getMeshType() == TSMesh::SkinMeshType && currTime != mLastTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
TSShapeInstance::MeshObjectInstance::MeshObjectInstance()
|
TSShapeInstance::MeshObjectInstance::MeshObjectInstance()
|
||||||
: meshList(0), object(0), frame(0), matFrame(0),
|
: meshList(0), object(0), frame(0), matFrame(0),
|
||||||
visible(1.0f), forceHidden(false), mLastTime( 0 )
|
visible(1.0f), forceHidden(false), mLastTime(0), mLastObjectDetail(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ class TSShapeInstance
|
||||||
S32 frame;
|
S32 frame;
|
||||||
S32 matFrame;
|
S32 matFrame;
|
||||||
F32 visible;
|
F32 visible;
|
||||||
|
S32 mLastObjectDetail;
|
||||||
/// If true this mesh is forced to be hidden
|
/// If true this mesh is forced to be hidden
|
||||||
/// regardless of the animation state.
|
/// regardless of the animation state.
|
||||||
bool forceHidden;
|
bool forceHidden;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue