mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
Hardware Skinning Support
- Supports GL, D3D9 & D3D11 - Extends vertex formats & shadergen to support blend indices and weights - Adds basic support for using 4x3 matrices for shader constants - Supports software fallback
This commit is contained in:
parent
507c239a87
commit
3496c549b5
72 changed files with 2533 additions and 1327 deletions
|
|
@ -35,6 +35,7 @@
|
|||
#include "gfx/sim/cubemapData.h"
|
||||
#include "gfx/gfxCubemap.h"
|
||||
#include "core/util/safeDelete.h"
|
||||
#include "ts/tsShape.h"
|
||||
|
||||
class MatInstParameters;
|
||||
|
||||
|
|
@ -248,8 +249,10 @@ void MatInstance::construct()
|
|||
mActiveParameters = NULL;
|
||||
mDefaultParameters = NULL;
|
||||
mHasNormalMaps = false;
|
||||
mUsesHardwareSkinning = false;
|
||||
mIsForwardLit = false;
|
||||
mIsValid = false;
|
||||
mIsHardwareSkinned = false;
|
||||
|
||||
MATMGR->_track(this);
|
||||
}
|
||||
|
|
@ -360,6 +363,11 @@ bool MatInstance::processMaterial()
|
|||
|
||||
FeatureSet features( mFeatureList );
|
||||
features.exclude( MATMGR->getExclusionFeatures() );
|
||||
|
||||
if (mVertexFormat->hasBlendIndices() && TSShape::smUseHardwareSkinning)
|
||||
{
|
||||
features.addFeature( MFT_HardwareSkinning );
|
||||
}
|
||||
|
||||
if( !mProcessedMaterial->init(features, mVertexFormat, mFeaturesDelegate) )
|
||||
{
|
||||
|
|
@ -373,11 +381,14 @@ bool MatInstance::processMaterial()
|
|||
|
||||
const FeatureSet &finalFeatures = mProcessedMaterial->getFeatures();
|
||||
mHasNormalMaps = finalFeatures.hasFeature( MFT_NormalMap );
|
||||
mUsesHardwareSkinning = finalFeatures.hasFeature( MFT_HardwareSkinning );
|
||||
|
||||
mIsForwardLit = ( custMat && custMat->mForwardLit ) ||
|
||||
( !finalFeatures.hasFeature( MFT_IsEmissive ) &&
|
||||
finalFeatures.hasFeature( MFT_ForwardShading ) );
|
||||
|
||||
mIsHardwareSkinned = finalFeatures.hasFeature( MFT_HardwareSkinning );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -455,6 +466,12 @@ void MatInstance::setTransforms(const MatrixSet &matrixSet, SceneRenderState *st
|
|||
mProcessedMaterial->setTransforms(matrixSet, state, getCurPass());
|
||||
}
|
||||
|
||||
void MatInstance::setNodeTransforms(const MatrixF *address, const U32 numTransforms)
|
||||
{
|
||||
PROFILE_SCOPE(MatInstance_setNodeTransforms);
|
||||
mProcessedMaterial->setNodeTransforms(address, numTransforms, getCurPass());
|
||||
}
|
||||
|
||||
void MatInstance::setSceneInfo(SceneRenderState * state, const SceneData& sgData)
|
||||
{
|
||||
PROFILE_SCOPE(MatInstance_setSceneInfo);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue