OGRE: Ogre::RTShader::HardwareSkinningFactory Class Reference

| OGRE 14.5 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Ogre::RTShader::HardwareSkinningFactory Class Reference
Optional Components » RTShaderSystem

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

`#include <OgreShaderExHardwareSkinning.h>`

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

## Public Member Functions
| HardwareSkinningFactory ()
| ~HardwareSkinningFactory ()
SubRenderState * | createInstance (const ScriptProperty &prop, Pass *pass, SGScriptTranslator *translator) override
const String & | getType () const override
void | writeInstance (MaterialSerializer *ser, SubRenderState *subRenderState, Pass *srcPass, Pass *dstPass) override
Public Member Functions inherited from Ogre::RTShader::SubRenderStateFactory
| SubRenderStateFactory ()
virtual | ~SubRenderStateFactory ()
virtual SubRenderState * | createInstance ()
| Create an instance of the SubRenderState sub class it suppose to create.
virtual SubRenderState * | createInstance (const ScriptProperty &prop, TextureUnitState *texState, SGScriptTranslator *translator)
| Create an instance of the SubRenderState based on script properties.
virtual SubRenderState * | createInstance (ScriptCompiler *compiler, PropertyAbstractNode *prop, Pass *pass, SGScriptTranslator *translator)
virtual SubRenderState * | createInstance (ScriptCompiler *compiler, PropertyAbstractNode *prop, TextureUnitState *texState, SGScriptTranslator *translator)
virtual SubRenderState * | createOrRetrieveInstance (SGScriptTranslator *translator)
| Retrieve the previous instance the SRS in the script translator or create a new instance if not found.
virtual void | destroyAllInstances ()
| Destroy all the instances that created by this factory.
virtual void | destroyInstance (SubRenderState *subRenderState)
| Destroy the given instance.
virtual void | writeInstance (MaterialSerializer *ser, SubRenderState *subRenderState, const TextureUnitState *srcTextureUnit, const TextureUnitState *dstTextureUnit)
| Write the given sub-render state instance using the material serializer.
Public Member Functions inherited from Ogre::Singleton< HardwareSkinningFactory >
| ~Singleton (void)

## Static Public Member Functions
static const MaterialPtr & | getCustomShadowCasterMaterial (const SkinningType skinningType, ushort index)
| Returns the name of a custom shadow caster material for a given number of weights.
static const MaterialPtr & | getCustomShadowReceiverMaterial (const SkinningType skinningType, ushort index)
| Returns the name of a custom shadow receiver material for a given number of weights.
static ushort | getMaxCalculableBoneCount ()
| The maximum number of bones for which hardware skinning is performed.
static HardwareSkinningFactory & | getSingleton (void)
| Override standard Singleton retrieval.
static HardwareSkinningFactory * | getSingletonPtr (void)
| Get the singleton instance.
static 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).
static 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.
static 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.
static void | setMaxCalculableBoneCount (ushort count)
| Sets the maximum number of bones for which hardware skinning is performed.
Static Public Member Functions inherited from Ogre::Singleton< HardwareSkinningFactory >
static HardwareSkinningFactory & | getSingleton (void)
| Get the singleton instance.
static HardwareSkinningFactory * | getSingletonPtr (void)
| Get the singleton instance.

## Detailed Description

A factory that enables creation of HardwareSkinning instances.

Remarks
  Sub class of SubRenderStateFactory

## Constructor & Destructor Documentation

## ◆ HardwareSkinningFactory()

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

Referenced by getSingleton(), and getSingletonPtr().

## ◆ ~HardwareSkinningFactory()

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

## Member Function Documentation

## ◆ getType()

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

See also
  SubRenderStateFactory::getType.

Implements Ogre::RTShader::SubRenderStateFactory.

## ◆ createInstance()

SubRenderState * Ogre::RTShader::HardwareSkinningFactory::createInstance | ( | const ScriptProperty & | prop,
|  | Pass * | pass,
|  | SGScriptTranslator * | translator )
| overridevirtual

See also
  SubRenderStateFactory::createInstance.

Reimplemented from Ogre::RTShader::SubRenderStateFactory.

## ◆ writeInstance()

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

See also
  SubRenderStateFactory::writeInstance.

Reimplemented from Ogre::RTShader::SubRenderStateFactory.

## ◆ setCustomShadowCasterMaterials()

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

Sets the list of custom shadow caster materials.

## ◆ setCustomShadowReceiverMaterials()

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

Sets the list of custom shadow receiver materials.

## ◆ getCustomShadowCasterMaterial()

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

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 )
| static

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

## ◆ prepareEntityForSkinning()

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

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.

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

References Ogre::RTShader::ST_LINEAR.

## ◆ getMaxCalculableBoneCount()

ushort Ogre::RTShader::HardwareSkinningFactory::getMaxCalculableBoneCount | ( |  | ) |
| inlinestatic

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

## ◆ setMaxCalculableBoneCount()

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

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

See also
  getMaxCalculableBoneCount()

## ◆ getSingleton()

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.

References HardwareSkinningFactory().

## ◆ getSingletonPtr()

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

Get the singleton instance.

References HardwareSkinningFactory().

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

- OgreShaderExHardwareSkinning.h