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:
James Urquhart 2015-01-10 19:41:25 +00:00
parent 507c239a87
commit 3496c549b5
72 changed files with 2533 additions and 1327 deletions

View file

@ -126,7 +126,11 @@ class TSShapeInstance
/// @{
/// Render! This draws the base-textured object.
virtual void render( S32 objectDetail, TSMaterialList *, const TSRenderState &rdata, F32 alpha );
virtual void render( S32 objectDetail, TSVertexBufferHandle &vb, TSMaterialList *, TSRenderState &rdata, F32 alpha, const char *meshName );
/// Updates the vertex buffer data for this mesh (used for software skinning)
virtual void updateVertexBuffer( S32 objectDetail, U8 *buffer );
virtual bool bufferNeedsUpdate( S32 objectDetail );
/// @}
/// @name Collision Routines
@ -157,18 +161,21 @@ class TSShapeInstance
/// If true this mesh is forced to be hidden
/// regardless of the animation state.
bool forceHidden;
TSVertexBufferHandle mVertexBuffer;
GFXPrimitiveBufferHandle mPrimitiveBuffer;
/// The time at which this mesh
/// was last rendered.
U32 mLastTime;
Vector<MatrixF> mActiveTransforms;
MeshObjectInstance();
virtual ~MeshObjectInstance() {}
void render( S32 objectDetail, TSMaterialList *, const TSRenderState &rdata, F32 alpha );
void render( S32 objectDetail, TSVertexBufferHandle &vb, TSMaterialList *, TSRenderState &rdata, F32 alpha, const char *meshName );
void updateVertexBuffer( S32 objectDetail, U8 *buffer );
bool bufferNeedsUpdate(S32 objectDetail);
/// Gets the mesh with specified detail level
TSMesh * getMesh(S32 num) const { return num<object->numMeshes ? *(meshList+num) : NULL; }
@ -268,7 +275,9 @@ protected:
/// equal mShapeResource if it was created from a resource.
TSShape *mShape;
/// Vertex buffer used for software skinning this instance
TSVertexBufferHandle mSoftwareVertexBuffer;
bool mOwnMaterialList; ///< Does this own the material list pointer?
bool mAlphaAlways;
@ -488,6 +497,8 @@ protected:
void render( const TSRenderState &rdata );
void render( const TSRenderState &rdata, S32 dl, F32 intraDL = 0.0f );
bool bufferNeedsUpdate(S32 objectDetail, S32 start, S32 end);
void animate() { animate( mCurrentDetailLevel ); }
void animate(S32 dl);
void animateNodes(S32 ss);