Go to the documentation of this file.
28 #ifndef __BaseInstanceBatchVTF_H__
29 #define __BaseInstanceBatchVTF_H__
173 void setBoneMatrixLookup(
bool enable,
size_t maxLookupTableInstances) { assert(mInstancedEntities.empty());
174 mUseBoneMatrixLookup = enable; mMaxLookupTableInstances = maxLookupTableInstances; }
182 mUseBoneDualQuaternions = enable; mRowLength = (mUseBoneDualQuaternions ? 2 : 3); }
187 mForceOneWeight = enable; }
192 mUseOneWeight = enable; }
vector< unsigned short >::type IndexMap
bool forceOneWeight() const
vector< Matrix4 >::type Matrix4Vec
vector< float >::type HWBoneWgtVec
void setBoneDualQuaternions(bool enable)
void cloneMaterial(const MaterialPtr &material)
Clones the base material so it can have it's own vertex texture, and also clones it's shadow caster m...
size_t convert3x4MatricesToDualQuaternions(float *matrices, size_t numOfMatrices, float *outDualQuaternions)
void createVertexSemantics(VertexData *thisVertexData, VertexData *baseVertexData, const HWBoneIdxVec &hwBoneIdx, const HWBoneWgtVec &hwBoneWgt)
Creates 2 TEXCOORD semantics that will be used to sample the vertex texture.
size_t calculateMaxNumInstances(const SubMesh *baseSubMesh, uint16 flags) const
void getWorldTransforms(Matrix4 *xform) const
Gets the world transform matrix / matrices for this renderable object.
void createVertexTexture(const SubMesh *baseSubMesh)
Creates the vertex texture.
This is the main starting point for the new instancing system.
unsigned short getNumWorldTransforms(void) const
Returns the number of world transform matrices this renderable requires.
TexturePtr mMatrixTexture
virtual void createVertexSemantics(VertexData *thisVertexData, VertexData *baseVertexData, const HWBoneIdxVec &hwBoneIdx, const HWBoneWgtVec &hwBoneWgt)=0
Creates 2 TEXCOORD semantics that will be used to sample the vertex texture.
InstanceBatchVTF(InstanceManager *creator, MeshPtr &meshReference, const MaterialPtr &material, size_t instancesPerBatch, const Mesh::IndexMap *indexToBoneMap, const String &batchName)
size_t mMatricesPerInstance
float * mTempTransformsArray3x4
void setUseOneWeight(bool enable)
void setForceOneWeight(bool enable)
void buildFrom(const SubMesh *baseSubMesh, const RenderOperation &renderOperation)
virtual bool matricesTogetherPerRow() const =0
Affects VTF texture's width dimension.
void setBoneMatrixLookup(bool enable, size_t maxLookupTableInstances)
Sets the state of the usage of bone matrix lookup.
Summary class collecting together vertex source information.
bool mUseBoneDualQuaternions
void setupMaterialToUseVTF(TextureType textureType, MaterialPtr &material)
Setups the material to use a vertex texture.
Class encapsulating a standard 4x4 homogeneous matrix.
virtual ~InstanceBatchVTF()
void _updateRenderQueue(RenderQueue *queue)
Overloaded to be able to updated the vertex texture.
bool mUseBoneMatrixLookup
virtual size_t getMaxLookupTableInstances() const
Defines a part of a complete mesh.
size_t mWidthFloatsPadding
void setupVertices(const SubMesh *baseSubMesh)
virtual ~BaseInstanceBatchVTF()
virtual bool useBoneWorldMatrices() const
virtual bool matricesTogetherPerRow() const
Affects VTF texture's width dimension.
bool useBoneDualQuaternions() const
Instancing implementation using vertex texture through Vertex Texture Fetch (VTF) This implementation...
size_t mMaxLookupTableInstances
virtual InstancedEntity * generateInstancedEntity(size_t num)
bool useOneWeight() const
void setupIndices(const SubMesh *baseSubMesh)
void retrieveBoneIdx(VertexData *baseVertexData, HWBoneIdxVec &outBoneIdx)
Retrieves bone data from the original sub mesh and puts it into an appropriate buffer,...
void retrieveBoneIdxWithWeights(VertexData *baseVertexData, HWBoneIdxVec &outBoneIdx, HWBoneWgtVec &outBoneWgt)
bool useBoneMatrixLookup() const
Tells whether to use bone matrix lookup.
void updateVertexTexture(void)
Keeps filling the VTF with world matrix data.
virtual void updateSharedLookupIndexes()
update the lookup numbers for entities with shared transforms
BaseInstanceBatchVTF(InstanceManager *creator, MeshPtr &meshReference, const MaterialPtr &material, size_t instancesPerBatch, const Mesh::IndexMap *indexToBoneMap, const String &batchName)
InstanceBatch forms part of the new Instancing system This is an abstract class that must be derived ...
TextureType
Enum identifying the texture type.
'New' rendering operation using vertex buffers.
Class to manage the scene object rendering queue.
vector< uint8 >::type HWBoneIdxVec
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.