This reference page is linked to from the following overview topics: MotionBuilder 2014, MotionBuilder 2013, Your First Python Program, Scene Elements, FBModel - Transformation Data and the Scene Graph.
Shader class.
Definition at line 458 of file fbshader.h.
#include <fbshader.h>
Public Member Functions | |
FBShader (const char *pName, HIObject pObject=NULL) | |
Protected constructor. | |
IObject_Declare (K_IMPLEMENTATION) | |
virtual FBShaderModelInfo * | NewShaderModelInfo (HKModelRenderInfo pModelRenderInfo, int pSubRegionIndex) |
Create a new shader-model information object. | |
virtual void | UpdateModelShaderInfo (FBRenderOptions *pOptions, FBShaderModelInfo *pInfo) |
Update shader-model information when model, material & texture mapping or shader setting change. | |
virtual void | DestroyShaderModelInfo (FBRenderOptions *pOptions, FBShaderModelInfo *pInfo) |
Destroy shader-model information object callback. | |
virtual void | ReplaceAll (FBModel *pModel) |
Replace all shader in pModel. | |
virtual void | Append (FBModel *pModel) |
Append shader to pModel. | |
virtual bool | ShaderNeedBeginRender () |
Does the shader need a begin render call. | |
virtual void | ShaderBeginRender (FBRenderOptions *pOptions, FBShaderModelInfo *pInfo) |
Pre-rendering of shaders that is called only one time for a shader instance. | |
virtual void | ShadeModel (FBRenderOptions *pOptions, FBShaderModelInfo *pInfo, FBRenderingPass pPass) |
Real-time shading callback for shader without kFBShaderCapacityMaterialEffect. | |
virtual void | ShadeModelShadow (FBRenderOptions *pRenderOptions, FBShaderModelInfo *pInfo) |
Draw custom shadow shape callback for shader with kFBShaderCapacityDrawShadow but without kFBShaderCapacityMaterialEffect. | |
virtual void | CloneShaderParameter (FBShader *pNewShader) |
Clone shader. | |
virtual void | DetachDisplayContext (FBRenderOptions *pOptions, FBShaderModelInfo *pInfo) |
Detach the display context from the shader. | |
virtual bool | FbxStore (FBFbxObject *pFbxObject) |
Storage of information into the FBX file format. | |
virtual bool | FbxRetrieve (FBFbxObject *pFbxObject, FBRenderer *pRenderer) |
Retrieval of information into the FBX file format. | |
void | InvalidateShaderVersion () |
Invalidate Shader version to trigger model-shader informaton to be updated. | |
int | GetShaderVersion () const |
Return Shader Version. | |
FBShaderCapacity | GetShaderCapacity () const |
Return Shader Capacity (bitwise value) | |
bool | HasShaderCapacity (FBShaderCapacity pCapacity) |
Return true if shader has certain capacity. | |
void | SetShaderCapacity (FBShaderCapacity pCapacity, bool pOn) |
Set Shader Capacity (bitwise value). | |
int | GetDrawInstancedMaximumSize () const |
Get shader maximum size for draw instanced. | |
void | SetDrawInstancedMaximumSize (int pMaxSize) |
Set shader maximum size for draw instanced. | |
virtual void | UploadModelViewMatrixArrayForDrawInstanced (const double *pModelViewMatrixArray, int pCount) |
Callback for uploading the modelview array when draw instanced. | |
Real-time shading callbacks for kFBMaterialEffectShader. | |
virtual void | ShaderPassTypeBegin (FBRenderOptions *pRenderOptions, FBRenderingPass pPass) |
For all the shader instances of the same type, to setup the common state for all this type of shaders. | |
virtual void | ShaderPassTypeEnd (FBRenderOptions *pRenderOptions, FBRenderingPass pPass) |
For all the shader instances of the same type, to clean the common state for all this type of shaders. | |
virtual void | ShaderPassInstanceBegin (FBRenderOptions *pRenderOptions, FBRenderingPass pPass) |
For all the models associated with this shader instance, to setup the common state for this shader instance. | |
virtual void | ShaderPassInstanceEnd (FBRenderOptions *pRenderOptions, FBRenderingPass pPass) |
For all the models associated with this shader instance, to clean the common state for this shader instance. | |
virtual void | ShaderPassMaterialBegin (FBRenderOptions *pRenderOptions, FBRenderingPass pPass, FBShaderModelInfo *pInfo) |
For all the models mapped with this material and associated with this shader instance, to setup the common material state for this shader instance. | |
virtual void | ShaderPassMaterialEnd (FBRenderOptions *pRenderOptions, FBRenderingPass pPass, FBShaderModelInfo *pInfo) |
For all the models mapped with this material and associated with this shader instance, to clean the common material state for this shader instance. | |
virtual void | ShaderPassGeometryBegin (FBRenderOptions *pRenderOptions, FBRenderingPass pPass, FBShaderModelInfo *pInfo) |
For all the models instanced from the same geometry, to setup the common VBO state for this shader instance. | |
virtual void | ShaderPassGeometryEnd (FBRenderOptions *pRenderOptions, FBRenderingPass pPass, FBShaderModelInfo *pInfo) |
For all the models instanced from the same geometry, to clean the common VBO state for this shader instance. | |
virtual void | ShaderPassModelsDraw (FBRenderOptions *pRenderOptions, FBRenderingPass pPass, const FBArrayTemplate< FBShaderModelInfo * > &pInfoArray) |
For all the models with the same material/geometry mappings, inside this functions, we only need to setup modelview matrix, and draw the meshes. | |
virtual void | ShaderPassModelDraw (FBRenderOptions *pRenderOptions, FBRenderingPass pPass, FBShaderModelInfo *pInfo) |
Callback for Cg/CgFx shader to setup WorldMaitrx/WorldMatrixIT parameters. | |
virtual void | ShaderPassDrawShadowBegin (FBRenderOptions *pRenderOptions) |
Shadow draw pass begin notify for shader with kFBShaderCapacityMaterialEffect and kFBShaderCapacityDrawShow. | |
virtual void | ShaderPassDrawShadowEnd (FBRenderOptions *pRenderOptions) |
Shadow draw pass end notify for shader with kFBShaderCapacityMaterialEffect and kFBShaderCapacityDrawShow. | |
FBShaderPassActionCallback | GetShaderPassActionCallback () const |
Get Shader Pass Action Callback registration;. | |
void | SetShaderPassActionCallback (FBShaderPassActionCallback pCallback) |
Set Shader Pass Action Callback registration;. | |
Public Attributes | |
const char * | ShaderDescription |
Description. | |
FBPropertyBool | Enable |
Read Write Property: Is the shader Enabled | |
FBPropertyRenderingPass | RenderingPass |
Read Write Property: Rendering pass object are shaded in. | |
Static Protected Member Functions | |
static FBRenderingPass | GetRenderingPassNeededForAlpha (FBAlphaSource pTransparency) |
In order to be called at the right passes, a shader must set the result of GetRenderingPassNeededForAlpha() to RenderingPass for a given transparency type. |
FBShader | ( | const char * | pName, |
HIObject | pObject = NULL |
||
) |
Protected constructor.
pName | Shader name. |
pObject | Internal parent object to own shader(default=NULL). |
IObject_Declare | ( | K_IMPLEMENTATION | ) |
Reimplemented from FBBox.
virtual FBShaderModelInfo* NewShaderModelInfo | ( | HKModelRenderInfo | pModelRenderInfo, |
int | pSubRegionIndex | ||
) | [virtual] |
Create a new shader-model information object.
pModelRenderInfo | Internal Model Render Info. |
pSubRegionIndex |
virtual void UpdateModelShaderInfo | ( | FBRenderOptions * | pOptions, |
FBShaderModelInfo * | pInfo | ||
) | [virtual] |
Update shader-model information when model, material & texture mapping or shader setting change.
pOptions | Render options. |
pInfo | Shader-model information object to be updated. |
virtual void DestroyShaderModelInfo | ( | FBRenderOptions * | pOptions, |
FBShaderModelInfo * | pInfo | ||
) | [virtual] |
Destroy shader-model information object callback.
pOptions | Render options. |
pInfo | Shader-model information object to destroy. |
virtual void ReplaceAll | ( | FBModel * | pModel | ) | [virtual] |
Replace all shader in pModel.
pModel | Model to replace all shader to. |
virtual void Append | ( | FBModel * | pModel | ) | [virtual] |
virtual bool ShaderNeedBeginRender | ( | ) | [virtual] |
Does the shader need a begin render call.
virtual void ShaderBeginRender | ( | FBRenderOptions * | pOptions, |
FBShaderModelInfo * | pInfo | ||
) | [virtual] |
Pre-rendering of shaders that is called only one time for a shader instance.
virtual void ShadeModel | ( | FBRenderOptions * | pOptions, |
FBShaderModelInfo * | pInfo, | ||
FBRenderingPass | pPass | ||
) | [virtual] |
Real-time shading callback for shader without kFBShaderCapacityMaterialEffect.
This is called after all the calls to ShaderBeginRender.
pOptions | Render options. |
pPass | Rendering pass. |
pInfo | Shader-model information. |
virtual void ShadeModelShadow | ( | FBRenderOptions * | pRenderOptions, |
FBShaderModelInfo * | pInfo | ||
) | [virtual] |
Draw custom shadow shape callback for shader with kFBShaderCapacityDrawShadow but without kFBShaderCapacityMaterialEffect.
pRenderOptions | Render options. |
pInfo | Shader-model information. |
virtual void ShaderPassTypeBegin | ( | FBRenderOptions * | pRenderOptions, |
FBRenderingPass | pPass | ||
) | [virtual] |
For all the shader instances of the same type, to setup the common state for all this type of shaders.
pRenderOptions | Render options. |
pPass | Rendering pass. |
virtual void ShaderPassTypeEnd | ( | FBRenderOptions * | pRenderOptions, |
FBRenderingPass | pPass | ||
) | [virtual] |
For all the shader instances of the same type, to clean the common state for all this type of shaders.
pRenderOptions | Render options. |
pPass | Rendering pass. |
virtual void ShaderPassInstanceBegin | ( | FBRenderOptions * | pRenderOptions, |
FBRenderingPass | pPass | ||
) | [virtual] |
For all the models associated with this shader instance, to setup the common state for this shader instance.
pRenderOptions | Render options. |
pPass | Rendering pass. |
virtual void ShaderPassInstanceEnd | ( | FBRenderOptions * | pRenderOptions, |
FBRenderingPass | pPass | ||
) | [virtual] |
For all the models associated with this shader instance, to clean the common state for this shader instance.
pRenderOptions | Render options. |
pPass | Rendering pass. |
virtual void ShaderPassMaterialBegin | ( | FBRenderOptions * | pRenderOptions, |
FBRenderingPass | pPass, | ||
FBShaderModelInfo * | pInfo | ||
) | [virtual] |
For all the models mapped with this material and associated with this shader instance, to setup the common material state for this shader instance.
pRenderOptions | Render options. |
pPass | Rendering pass. |
pInfo | Shader-model information. |
virtual void ShaderPassMaterialEnd | ( | FBRenderOptions * | pRenderOptions, |
FBRenderingPass | pPass, | ||
FBShaderModelInfo * | pInfo | ||
) | [virtual] |
For all the models mapped with this material and associated with this shader instance, to clean the common material state for this shader instance.
pRenderOptions | Render options. |
pPass | Rendering pass. |
pInfo | Shader-model information. |
virtual void ShaderPassGeometryBegin | ( | FBRenderOptions * | pRenderOptions, |
FBRenderingPass | pPass, | ||
FBShaderModelInfo * | pInfo | ||
) | [virtual] |
For all the models instanced from the same geometry, to setup the common VBO state for this shader instance.
pRenderOptions | Render options. |
pPass | Rendering pass. |
pInfo | Shader-model information. |
virtual void ShaderPassGeometryEnd | ( | FBRenderOptions * | pRenderOptions, |
FBRenderingPass | pPass, | ||
FBShaderModelInfo * | pInfo | ||
) | [virtual] |
For all the models instanced from the same geometry, to clean the common VBO state for this shader instance.
pRenderOptions | Render options. |
pPass | Rendering pass. |
pInfo | Shader-model information. |
virtual void ShaderPassModelsDraw | ( | FBRenderOptions * | pRenderOptions, |
FBRenderingPass | pPass, | ||
const FBArrayTemplate< FBShaderModelInfo * > & | pInfoArray | ||
) | [virtual] |
For all the models with the same material/geometry mappings, inside this functions, we only need to setup modelview matrix, and draw the meshes.
pRenderOptions | Render options. |
pPass | Rendering pass. |
pInfoArray | An array of Shader-model information to be displayed. |
virtual void ShaderPassModelDraw | ( | FBRenderOptions * | pRenderOptions, |
FBRenderingPass | pPass, | ||
FBShaderModelInfo * | pInfo | ||
) | [virtual] |
Callback for Cg/CgFx shader to setup WorldMaitrx/WorldMatrixIT parameters.
pRenderOptions | Render options. |
pPass | Rendering pass. |
pInfo | Shader-model information. |
virtual void ShaderPassDrawShadowBegin | ( | FBRenderOptions * | pRenderOptions | ) | [virtual] |
Shadow draw pass begin notify for shader with kFBShaderCapacityMaterialEffect and kFBShaderCapacityDrawShow.
pRenderOptions | Render options. |
virtual void ShaderPassDrawShadowEnd | ( | FBRenderOptions * | pRenderOptions | ) | [virtual] |
Shadow draw pass end notify for shader with kFBShaderCapacityMaterialEffect and kFBShaderCapacityDrawShow.
pRenderOptions | Render options. |
FBShaderPassActionCallback GetShaderPassActionCallback | ( | ) | const |
Get Shader Pass Action Callback registration;.
void SetShaderPassActionCallback | ( | FBShaderPassActionCallback | pCallback | ) |
Set Shader Pass Action Callback registration;.
virtual void CloneShaderParameter | ( | FBShader * | pNewShader | ) | [virtual] |
virtual void DetachDisplayContext | ( | FBRenderOptions * | pOptions, |
FBShaderModelInfo * | pInfo | ||
) | [virtual] |
Detach the display context from the shader.
pOptions | Render options. |
pInfo | Shader-model information object. |
virtual bool FbxStore | ( | FBFbxObject * | pFbxObject | ) | [virtual] |
Storage of information into the FBX file format.
pFbxObject | Object to interface with FBX file format. |
virtual bool FbxRetrieve | ( | FBFbxObject * | pFbxObject, |
FBRenderer * | pRenderer | ||
) | [virtual] |
Retrieval of information into the FBX file format.
pFbxObject | Object to interface with FBX file format. |
pRenderer | Renderer being restored. |
void InvalidateShaderVersion | ( | ) |
Invalidate Shader version to trigger model-shader informaton to be updated.
int GetShaderVersion | ( | ) | const |
Return Shader Version.
FBShaderCapacity GetShaderCapacity | ( | ) | const |
Return Shader Capacity (bitwise value)
bool HasShaderCapacity | ( | FBShaderCapacity | pCapacity | ) |
Return true if shader has certain capacity.
void SetShaderCapacity | ( | FBShaderCapacity | pCapacity, |
bool | pOn | ||
) |
Set Shader Capacity (bitwise value).
Only when the shader is not connected to any model, this function will take effect. otherwise, it will be ignored.
int GetDrawInstancedMaximumSize | ( | ) | const |
Get shader maximum size for draw instanced.
void SetDrawInstancedMaximumSize | ( | int | pMaxSize | ) |
Set shader maximum size for draw instanced.
virtual void UploadModelViewMatrixArrayForDrawInstanced | ( | const double * | pModelViewMatrixArray, |
int | pCount | ||
) | [virtual] |
Callback for uploading the modelview array when draw instanced.
pModelViewMatrixArray | pointer of 4x4 column major modelview matrix array, length is 4*4*pCount; |
pCount | number of modelview matrixs in the array. |
static FBRenderingPass GetRenderingPassNeededForAlpha | ( | FBAlphaSource | pTransparency | ) | [static, protected] |
In order to be called at the right passes, a shader must set the result of GetRenderingPassNeededForAlpha() to RenderingPass for a given transparency type.
It should not be called at rendering time.
pTransparency | Transparency type. |
const char* ShaderDescription |
Read Write Property: Is the shader Enabled
Definition at line 673 of file fbshader.h.
FBPropertyRenderingPass RenderingPass |
Read Write Property: Rendering pass object are shaded in.
Set the property to kFBPassFlat if you want to be called at the first pass, kFBPassPostRender at the second pass, kFBPassFlat | kFBPassPostRender at both. The current pass will be the third argument of ShadeModel()
Definition at line 680 of file fbshader.h.