Public Member Functions | Public Attributes | Static Protected Member Functions | Protected Attributes

FBShader Class Reference

This reference page is linked to from the following overview topics: Your First Python Program, Scene Elements, FBModel - Transformation Data and the Scene Graph.


Search for all occurrences

Detailed Description

Shader class.

Definition at line 385 of file fbshader.h.

#include <fbshader.h>

Inheritance diagram for FBShader:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  FBShader (const char *pName, HIObject pObject=NULL)
  Protected constructor.
  IObject_Declare (Implementation)
virtual HFBShaderModelInfo  NewShaderModelInfo (HFBRenderOptions pOptions, HIGraphicPrimitives pGPS)
  Create a new shader-model information object.
virtual void  DestroyShaderModelInfo (HFBRenderOptions pOptions, HFBShaderModelInfo pInfo)
  Destroy shader-model information object callback.
virtual void  ReplaceAll (HFBModel pModel)
  Replace all shader in pModel.
virtual void  Append (HFBModel pModel)
  Append shader to pModel.
virtual bool  ShaderNeedBeginRender ()
  Does the shader need a begin render call.
virtual void  ShaderBeginRender (HFBRenderOptions pOptions, HFBShaderModelInfo pInfo)
  Pre-rendering of shaders that is called only one time for a shader instance.
virtual void  ShadeModel (HFBRenderOptions pOptions, HFBShaderModelInfo pInfo, FBRenderingPass pPass)
  Real-time shading callback.
virtual void  CloneShaderParameter (HFBShader pNewShader)
  Clone shader.
virtual void  DetachDisplayContext (HFBRenderOptions pOptions, HFBShaderModelInfo pInfo)
  Detach the display context from the shader.
virtual bool  FbxStore (HFBFbxObject pFbxObject)
  Storage of information into the FBX file format.
virtual bool  FbxRetrieve (HFBFbxObject pFbxObject, HFBRenderer pRenderer)
  Retrieval of information into the FBX file format.
int  GetShaderVersion () const
  Return Shader Version.

Public Attributes

char *  ShaderDescription
  Description.
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.

Protected Attributes

int  mShader_Version

Constructor & Destructor Documentation

FBShader ( const char *  pName,
HIObject  pObject = NULL 
)

Protected constructor.

Parameters:
pName Shader name.
pObject Internal parent object to own shader(default=NULL).

Member Function Documentation

IObject_Declare ( Implementation  )

Reimplemented from FBBox.

virtual HFBShaderModelInfo NewShaderModelInfo ( HFBRenderOptions  pOptions,
HIGraphicPrimitives  pGPS 
) [virtual]

Create a new shader-model information object.

Parameters:
pOptions Render options.
pInfo Base shader-model information object.
Returns:
Newly allocated shader-model information object.
virtual void DestroyShaderModelInfo ( HFBRenderOptions  pOptions,
HFBShaderModelInfo  pInfo 
) [virtual]

Destroy shader-model information object callback.

Parameters:
pOptions Render options.
pInfo Shader-model information object to destroy.
virtual void ReplaceAll ( HFBModel  pModel ) [virtual]

Replace all shader in pModel.

Parameters:
pModel Model to replace all shader to.
virtual void Append ( HFBModel  pModel ) [virtual]

Append shader to pModel.

Parameters:
pModel Model to append shader to.
virtual bool ShaderNeedBeginRender ( ) [virtual]

Does the shader need a begin render call.

Remarks:
Re-implement this function and return true if you need it. This method is called once per shader on each render pass.
virtual void ShaderBeginRender ( HFBRenderOptions  pOptions,
HFBShaderModelInfo  pInfo 
) [virtual]

Pre-rendering of shaders that is called only one time for a shader instance.

Remarks:
ShaderBeginRender is called as many times as the number of models affected by the instance of the shader in a given render pass. (ShaderNeedBeginRender must return true for this function to be called).
virtual void ShadeModel ( HFBRenderOptions  pOptions,
HFBShaderModelInfo  pInfo,
FBRenderingPass  pPass 
) [virtual]

Real-time shading callback.

This is called after all the calls to ShaderBeginRender.

Parameters:
pOptions Render options.
pPass Rendering pass.
pInfo Shader-model information.
virtual void CloneShaderParameter ( HFBShader  pNewShader ) [virtual]

Clone shader.

Parameters:
pNewShader Shader to copy data to.
virtual void DetachDisplayContext ( HFBRenderOptions  pOptions,
HFBShaderModelInfo  pInfo 
) [virtual]

Detach the display context from the shader.

Parameters:
pOptions Render options.
pInfo Shader-model information object.
virtual bool FbxStore ( HFBFbxObject  pFbxObject ) [virtual]

Storage of information into the FBX file format.

Parameters:
pFbxObject Object to interface with FBX file format.
Returns:
true if successful, false otherwise.
virtual bool FbxRetrieve ( HFBFbxObject  pFbxObject,
HFBRenderer  pRenderer 
) [virtual]

Retrieval of information into the FBX file format.

Parameters:
pFbxObject Object to interface with FBX file format.
pRenderer Renderer being restored.
Returns:
true if successful, false otherwise.
int GetShaderVersion ( ) const [inline]

Return Shader Version.

Definition at line 473 of file fbshader.h.

{ return mShader_Version; }
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.

Parameters:
pTransparency Transparency type.
Returns:
a mask of all rendering passes needed for DrawGeometry() to work correctly.

Member Data Documentation

Description.

Definition at line 463 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 470 of file fbshader.h.

int mShader_Version [protected]

Definition at line 484 of file fbshader.h.


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

FBShader FBShader FBShader FBShader FBShader FBShader FBShader FBShader FBShader FBShader
FBShader FBShader FBShader FBShader FBShader FBShader FBShader FBShader FBShader FBShader