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