OGRE: Ogre::RTShader::HardwareSkinningFactory Class Reference

| OGRE 2.2.4 Object-Oriented Graphics Rendering Engine

Public Member Functions | Static Public Member Functions | List of all members
Ogre::RTShader::HardwareSkinningFactory Class Reference
Core » RTShader

A factory that enables creation of HardwareSkinning instances. More...

`#include <OgreShaderExHardwareSkinning.h>`

Inheritance diagram for Ogre::RTShader::HardwareSkinningFactory:
[legend]

## Public Member Functions
| HardwareSkinningFactory ()
virtual SubRenderState * | createInstance ()
| Create an instance of the SubRenderState sub class it suppose to create. More...
virtual SubRenderState * | createInstance (ScriptCompiler *compiler, PropertyAbstractNode *prop, Pass *pass, SGScriptTranslator *translator)
virtual SubRenderState * | createInstance (ScriptCompiler *compiler, PropertyAbstractNode *prop, TextureUnitState *texState, SGScriptTranslator *translator)
| Create an instance of the SubRenderState based on script properties. More...
virtual SubRenderState * | createOrRetrieveInstance (SGScriptTranslator *translator)
| Retrieve the previous instance the SRS in the script translator or create a new instance if not found. More...
virtual void | destroyAllInstances ()
| Destroy all the instances that created by this factory. More...
virtual void | destroyInstance (SubRenderState *subRenderState)
| Destroy the given instance. More...
const MaterialPtr & | getCustomShadowCasterMaterial (const SkinningType skinningType, ushort index) const
| Returns the name of a custom shadow caster material for a given number of weights. More...
const MaterialPtr & | getCustomShadowReceiverMaterial (const SkinningType skinningType, ushort index) const
| Returns the name of a custom shadow receiver material for a given number of weights. More...
ushort | getMaxCalculableBoneCount () const
| The maximum number of bones for which hardware skinning is performed. More...
virtual const String & | getType () const
void | operator delete (void *ptr)
void | operator delete (void *ptr, const char *, int, const char *)
void | operator delete (void *ptr, void *)
void | operator delete[] (void *ptr)
void | operator delete[] (void *ptr, const char *, int, const char *)
void * | operator new (size_t sz)
void * | operator new (size_t sz, const char *file, int line, const char *func)
| operator new, with debug line info More...
void * | operator new (size_t sz, void *ptr)
| placement operator new More...
void * | operator new[] (size_t sz)
void * | operator new[] (size_t sz, const char *file, int line, const char *func)
| array operator new, with debug line info More...
void | prepareEntityForSkinning (const Entity *pEntity, SkinningType skinningType=ST_LINEAR, bool correctAntidpodalityHandling=false, bool shearScale=false)
| Prepares an entity's material for use in the hardware skinning (HS). More...
virtual void | setCustomShadowCasterMaterials (const SkinningType skinningType, const MaterialPtr &caster1Weight, const MaterialPtr &caster2Weight, const MaterialPtr &caster3Weight, const MaterialPtr &caster4Weight)
| Sets the list of custom shadow caster materials. More...
virtual void | setCustomShadowReceiverMaterials (const SkinningType skinningType, const MaterialPtr &receiver1Weight, const MaterialPtr &receiver2Weight, const MaterialPtr &receiver3Weight, const MaterialPtr &receiver4Weight)
| Sets the list of custom shadow receiver materials. More...
void | setMaxCalculableBoneCount (ushort count)
| Sets the maximum number of bones for which hardware skinning is performed. More...
virtual void | writeInstance (MaterialSerializer *ser, SubRenderState *subRenderState, const TextureUnitState *srcTextureUnit, const TextureUnitState *dstTextureUnit)
| Write the given sub-render state instance using the material serializer. More...
virtual void | writeInstance (MaterialSerializer *ser, SubRenderState *subRenderState, Pass *srcPass, Pass *dstPass)

## Static Public Member Functions
static HardwareSkinningFactory & | getSingleton (void)
| Override standard Singleton retrieval. More...
static HardwareSkinningFactory * | getSingletonPtr (void)
| Override standard Singleton retrieval. More...

## Detailed Description

A factory that enables creation of HardwareSkinning instances.

Remarks
  Sub class of SubRenderStateFactory

## Constructor & Destructor Documentation

## ◆ HardwareSkinningFactory()

Ogre::RTShader::HardwareSkinningFactory::HardwareSkinningFactory | ( |  | ) |

## Member Function Documentation

## ◆ createInstance() [1/3]

virtual SubRenderState* Ogre::RTShader::SubRenderStateFactory::createInstance | ( |  | ) |
| virtualinherited

Create an instance of the SubRenderState sub class it suppose to create.

## ◆ createInstance() [2/3]

virtual SubRenderState* Ogre::RTShader::HardwareSkinningFactory::createInstance | ( | ScriptCompiler * | compiler,
|  | PropertyAbstractNode * | prop,
|  | Pass * | pass,
|  | SGScriptTranslator * | translator
| ) |  |
| virtual

See also
  SubRenderStateFactory::createInstance.

Reimplemented from Ogre::RTShader::SubRenderStateFactory.

## ◆ createInstance() [3/3]

virtual SubRenderState* Ogre::RTShader::SubRenderStateFactory::createInstance | ( | ScriptCompiler * | compiler,
|  | PropertyAbstractNode * | prop,
|  | TextureUnitState * | texState,
|  | SGScriptTranslator * | translator
| ) |  |
| inlinevirtualinherited

Create an instance of the SubRenderState based on script properties.

This method is called in the context of script parsing and let this factory the opportunity to create custom SubRenderState instances based on extended script properties.

Parameters

  compiler | The compiler instance.
  prop | The abstract property node.
  texState | The pass that is the parent context of this node.
  translator | The translator instance holding existing scripts.

Reimplemented in Ogre::RTShader::FFPAlphaTestFactory, and Ogre::RTShader::LayeredBlendingFactory.

## ◆ createOrRetrieveInstance()

virtual SubRenderState* Ogre::RTShader::SubRenderStateFactory::createOrRetrieveInstance | ( | SGScriptTranslator * | translator | ) |
| virtualinherited

Retrieve the previous instance the SRS in the script translator or create a new instance if not found.

Parameters

  translator | The translator instance holding existing scripts.

## ◆ destroyAllInstances()

virtual void Ogre::RTShader::SubRenderStateFactory::destroyAllInstances | ( |  | ) |
| virtualinherited

Destroy all the instances that created by this factory.

## ◆ destroyInstance()

virtual void Ogre::RTShader::SubRenderStateFactory::destroyInstance | ( | SubRenderState * | subRenderState | ) |
| virtualinherited

Destroy the given instance.

Parameters

  subRenderState | The instance to destroy.

## ◆ getCustomShadowCasterMaterial()

const MaterialPtr& Ogre::RTShader::HardwareSkinningFactory::getCustomShadowCasterMaterial | ( | const SkinningType | skinningType,
|  | ushort | index
| ) |  | const

Returns the name of a custom shadow caster material for a given number of weights.

## ◆ getCustomShadowReceiverMaterial()

const MaterialPtr& Ogre::RTShader::HardwareSkinningFactory::getCustomShadowReceiverMaterial | ( | const SkinningType | skinningType,
|  | ushort | index
| ) |  | const

Returns the name of a custom shadow receiver material for a given number of weights.

## ◆ getMaxCalculableBoneCount()

ushort Ogre::RTShader::HardwareSkinningFactory::getMaxCalculableBoneCount | ( |  | ) | const
| inline

The maximum number of bones for which hardware skinning is performed.

This number should be limited to avoid problems of using to many parameters in a shader. For example, in pixel shader 3 this should be around 70-90 dependent on other sub-render states in the shader.

The default value for this property is 70 which correspond to pixel shader model 3 limitations

## ◆ getSingleton()

static HardwareSkinningFactory& Ogre::RTShader::HardwareSkinningFactory::getSingleton | ( | void |  | ) |
| static

Override standard Singleton retrieval.

Remarks
  Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.

  This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.

## ◆ getSingletonPtr()

static HardwareSkinningFactory* Ogre::RTShader::HardwareSkinningFactory::getSingletonPtr | ( | void |  | ) |
| static

Override standard Singleton retrieval.

Remarks
  Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.

  This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.

## ◆ getType()

virtual const String& Ogre::RTShader::HardwareSkinningFactory::getType | ( |  | ) | const
| virtual

See also
  SubRenderStateFactory::getType.

Implements Ogre::RTShader::SubRenderStateFactory.

## ◆ operator delete() [1/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) |
| inlineinherited

## ◆ operator delete() [2/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  |
| inlineinherited

## ◆ operator delete() [3/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | void * |
| ) |  |
| inlineinherited

## ◆ operator delete[]() [1/2]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) |
| inlineinherited

## ◆ operator delete[]() [2/2]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  |
| inlineinherited

## ◆ operator new() [1/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) |
| inlineinherited

## ◆ operator new() [2/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  |
| inlineinherited

operator new, with debug line info

## ◆ operator new() [3/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | void * | ptr
| ) |  |
| inlineinherited

placement operator new

## ◆ operator new[]() [1/2]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) |
| inlineinherited

## ◆ operator new[]() [2/2]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  |
| inlineinherited

array operator new, with debug line info

## ◆ prepareEntityForSkinning()

void Ogre::RTShader::HardwareSkinningFactory::prepareEntityForSkinning | ( | const Entity * | pEntity,
|  | SkinningType | skinningType = `ST_LINEAR`,
|  | bool | correctAntidpodalityHandling = `false`,
|  | bool | shearScale = `false`
| ) |  |

Prepares an entity's material for use in the hardware skinning (HS).

This function prepares an entity's material for use by the HS sub-render state. This function scans the entity and extracts the information of the amount of bones and weights in the entity. This function replaces the need specify in the material script the amount of bones and weights needed to make the HS work.

Note that this class does not save the the bone and weight count information internally. Rather this information is stored in the entity's materials as a user binded object.

Parameters

  pEntity | A pointer to an entity who's materials need preparing.

## ◆ setCustomShadowCasterMaterials()

virtual void Ogre::RTShader::HardwareSkinningFactory::setCustomShadowCasterMaterials | ( | const SkinningType | skinningType,
|  | const MaterialPtr & | caster1Weight,
|  | const MaterialPtr & | caster2Weight,
|  | const MaterialPtr & | caster3Weight,
|  | const MaterialPtr & | caster4Weight
| ) |  |
| virtual

Sets the list of custom shadow caster materials.

## ◆ setCustomShadowReceiverMaterials()

virtual void Ogre::RTShader::HardwareSkinningFactory::setCustomShadowReceiverMaterials | ( | const SkinningType | skinningType,
|  | const MaterialPtr & | receiver1Weight,
|  | const MaterialPtr & | receiver2Weight,
|  | const MaterialPtr & | receiver3Weight,
|  | const MaterialPtr & | receiver4Weight
| ) |  |
| virtual

Sets the list of custom shadow receiver materials.

## ◆ setMaxCalculableBoneCount()

void Ogre::RTShader::HardwareSkinningFactory::setMaxCalculableBoneCount | ( | ushort | count | ) |
| inline

Sets the maximum number of bones for which hardware skinning is performed.

See also
  getMaxCalculableBoneCount()

## ◆ writeInstance() [1/2]

virtual void Ogre::RTShader::SubRenderStateFactory::writeInstance | ( | MaterialSerializer * | ser,
|  | SubRenderState * | subRenderState,
|  | const TextureUnitState * | srcTextureUnit,
|  | const TextureUnitState * | dstTextureUnit
| ) |  |
| inlinevirtualinherited

Write the given sub-render state instance using the material serializer.

This method is called in the context of material serialization. It is useful for integrating into bigger context of material exporters from various environment that want to take advantage of the RT Shader System. Sub classes of this interface should override in case they need to write custom properties into the script context.

Parameters

  ser | The material serializer instance.
  subRenderState | The sub render state instance to write down.
  srcTextureUnit | The source texture unit state.
  dstTextureUnit | The generated shader based texture unit state.

Reimplemented in Ogre::RTShader::FFPAlphaTestFactory, and Ogre::RTShader::LayeredBlendingFactory.

## ◆ writeInstance() [2/2]

virtual void Ogre::RTShader::HardwareSkinningFactory::writeInstance | ( | MaterialSerializer * | ser,
|  | SubRenderState * | subRenderState,
|  | Pass * | srcPass,
|  | Pass * | dstPass
| ) |  |
| virtual

See also
  SubRenderStateFactory::writeInstance.

Reimplemented from Ogre::RTShader::SubRenderStateFactory.

The documentation for this class was generated from the following file:

- OgreShaderExHardwareSkinning.h