45 #include <kaydaradef.h>
50 #define FBSDK_DLL K_DLLIMPORT
56 K_FORWARD( KRenderOptions );
57 K_FORWARD( KModelRenderInfo );
58 K_FORWARD( KShaderModelInfo );
60 #ifdef FBSDKUseNamespace
61 namespace FBSDKNamespace {
71 #define FBRegisterShader( UniqueNameStr, ClassName, Label, Description, IconFilename ) \
72 HIObject RegisterShader##ClassName( HIObject ,const char* pName,void * ) \
74 ClassName *Class = new ClassName( pName ); \
75 Class->UniqueName = UniqueNameStr; \
76 Class->ShaderDescription = Description; \
77 if (Class->FBCreate()) { \
78 return Class->GetHIObject(); \
84 FBLibraryModule( ClassName ) \
86 FBRegisterObject( ClassName##R1,"renderer/usershader/ogl",Label,Description,RegisterShader##ClassName,true, IconFilename ); \
87 FBRegisterObject( ClassName##R2,"FbxStorable/Shader",UniqueNameStr,Description,RegisterShader##ClassName,true, IconFilename ); \
94 #define FBShaderDeclare( ClassName, Parent ) \
95 FBClassDeclare( ClassName,Parent); \
97 ClassName(const char* pName):Parent(pName) { FBClassInit; } \
103 #define FBShaderImplementation( ThisComponent ) \
104 FBClassImplementation( ThisComponent )
315 int GetSubRegionIndex();
336 KShaderModelInfo* mLocalPtr;
374 #ifndef DOXYGEN_SHOULD_SKIP_THIS
376 HKRenderOptions mRenderOptions;
419 kFBShaderCapacityNone = 0,
432 kFBShaderPassActionNone = 0,
433 kFBShaderPassTypeBegin = 1 << 0,
434 kFBShaderPassTypeEnd = 1 << 1,
435 kFBShaderPassInstanceBegin = 1 << 2,
436 kFBShaderPassInstanceEnd = 1 << 3,
437 kFBShaderPassMaterialBegin = 1 << 4,
438 kFBShaderPassMaterialEnd = 1 << 5,
439 kFBShaderPassGeometryBegin = 1 << 6,
440 kFBShaderPassGeometryEnd = 1 << 7,
441 kFBShaderPassModelsDraw = 1 << 8,
442 kFBShaderPassModelDraw = 1 << 9
462 FBShader(
const char* pName, HIObject pObject=NULL);
464 IObject_Declare(
override);
905 #ifdef FBSDKUseNamespace
Template class to contain an array of items.
A box is a fundamental building block in the application architecture.
Creates custom cameras and manages system cameras.
PropertyList: Concrete class for PropertyList of component
FBShader * operator[](int pIndex)
Get the shader from list at pIndex.
float GetIDBufferPickingAlphaThreshold() const
Get IDBuffer Picking Alpha threshold.
bool IsIDBufferRendering() const
Get IDBuffer Rendering request status (for display or picking)
FBCamera * GetRenderingCamera()
Get the rendering camera.
bool IsOfflineRendering() const
Check if the render request comes from offline render mode (as opposed to viewport refresh).
int GetRenderFrameId() const
Get Render Frame ID.
Open Reality renderer interface.
virtual void ShaderPassModelsDraw(FBRenderOptions *pRenderOptions, FBRenderingPass pPass, const FBArrayTemplate< FBShaderModelInfo * > &pInfoArray)
For all the models with the same material/geometry mappings, inside this functions,...
virtual void UploadModelViewMatrixArrayForDrawInstanced(const double *pModelViewMatrixArray, int pCount)
Callback for uploading the modelview array when draw instanced.
virtual bool Append(FBModel *pModel)
Append shader to pModel.
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 ShaderPassMaterialBegin(FBRenderOptions *pRenderOptions, FBRenderingPass pPass, FBShaderModelInfo *pInfo)
For all the models mapped with this material and associated with this shader instance,...
static FBRenderingPass GetRenderingPassNeededForAlpha(FBAlphaSource pTransparency)
In order to be called at the right passes, a shader must set the result of GetRenderingPassNeededForA...
virtual void ShaderPassDrawShadowEnd(FBRenderOptions *pRenderOptions)
Shadow draw pass end notify for shader with kFBShaderCapacityMaterialEffect and kFBShaderCapacityDraw...
FBPropertyRenderingPass RenderingPass
Read Write Property: Rendering pass object are shaded in.
virtual void UpdateModelShaderInfo(FBRenderOptions *pOptions, FBShaderModelInfo *pInfo)
Update shader-model information when model, material & texture mapping or shader setting change.
virtual void DetachDisplayContext(FBRenderOptions *pOptions, FBShaderModelInfo *pInfo)
Detach the display context from the shader.
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 ShaderPassInstanceEnd(FBRenderOptions *pRenderOptions, FBRenderingPass pPass)
For all the models associated with this shader instance, to clean the common state for this shader in...
FBShaderPassActionCallback GetShaderPassActionCallback() const
Get Shader Pass Action Callback registration;.
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 in...
void SetShaderPassActionCallback(FBShaderPassActionCallback pCallback)
Set Shader Pass Action Callback registration;.
void InvalidateShaderVersion()
Invalidate Shader version to trigger model-shader informaton to be updated.
virtual void ShaderPassMaterialEnd(FBRenderOptions *pRenderOptions, FBRenderingPass pPass, FBShaderModelInfo *pInfo)
For all the models mapped with this material and associated with this shader instance,...
virtual FBShaderModelInfo * NewShaderModelInfo(HKModelRenderInfo pModelRenderInfo, int pSubRegionIndex)
Create a new shader-model information object.
void SetDrawInstancedMaximumSize(int pMaxSize)
Set shader maximum size for draw instanced.
FBShader(const char *pName, HIObject pObject=NULL)
Protected constructor.
virtual void ShaderPassDrawShadowBegin(FBRenderOptions *pRenderOptions)
Shadow draw pass begin notify for shader with kFBShaderCapacityMaterialEffect and kFBShaderCapacityDr...
virtual void CloneShaderParameter(FBShader *pNewShader)
Clone shader.
virtual bool FbxStore(FBFbxObject *pFbxObject)
Storage of information into the FBX file format.
virtual bool ReplaceAll(FBModel *pModel)
Replace all shader in pModel.
virtual void ShaderPassInstanceBegin(FBRenderOptions *pRenderOptions, FBRenderingPass pPass)
For all the models associated with this shader instance, to setup the common state for this shader in...
virtual void ShadeModelShadow(FBRenderOptions *pRenderOptions, FBShaderModelInfo *pInfo)
Draw custom shadow shape callback for shader with kFBShaderCapacityDrawShadow but without kFBShaderCa...
virtual void DestroyShaderModelInfo(FBRenderOptions *pOptions, FBShaderModelInfo *pInfo)
Destroy shader-model information object callback.
FBShaderCapacity GetShaderCapacity() const
Return Shader Capacity (bitwise value)
virtual void ShadeModel(FBRenderOptions *pOptions, FBShaderModelInfo *pInfo, FBRenderingPass pPass)
Real-time shading callback for shader without kFBShaderCapacityMaterialEffect.
virtual void ShaderPassModelDraw(FBRenderOptions *pRenderOptions, FBRenderingPass pPass, FBShaderModelInfo *pInfo)
Callback for Cg/CgFx shader to setup WorldMaitrx/WorldMatrixIT parameters.
FBPropertyBool Enable
Read Write Property: Is the shader Enabled
int GetDrawInstancedMaximumSize() const
Get shader maximum size for draw instanced.
const char * ShaderDescription
Description.
int GetShaderVersion() const
Return Shader Version.
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.
void SetShaderCapacity(FBShaderCapacity pCapacity, bool pOn)
Set Shader Capacity (bitwise value).
bool HasShaderCapacity(FBShaderCapacity pCapacity)
Return true if shader has certain capacity.
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 in...
virtual bool FbxRetrieve(FBFbxObject *pFbxObject, FBRenderer *pRenderer)
Retrieval of information into the FBX file format.
FBPropertyAnimatableDouble Alpha
Read Write Property: Controls the actual effect of the shader on the object. At 0....
FBPropertyDouble Specular
Read Write Property: Changes an object's level of shininess when it reflects light by affecting the s...
FBPropertyAlphaSource Transparency
Read Write Property: Indicates the computation method of the transparency.
FBPropertyDouble Luminosity
Read Write Property: Changes the brightness of the object when reflecting light.
FBShaderLighted(const char *pName, HIObject pObject=NULL)
Constructor.
FBPropertyBool UseLuminosity
Read Write Property: Activate the Luminosity option.
FBPropertyBool UseContrast
Read Write Property: Activate the Contrast option.
FBPropertyDouble Contrast
Read Write Property: Changes the contrast of the object when it reflects light.
FBPropertyBool UseSpecular
Read Write Property: Activate the Specularity option.
FBStringList ShaderTypeNames
List of available shaders.
FBStringList ShaderTypeNamesLocalized
List of available shaders.
~FBShaderManager()
Destructor.
FBShader * CreateShader(const char *pShaderTypeName)
Creates a shader according to the shader type provided.
FBShaderManager()
Constructor.
bool GetOriginalTextureFlag() const
if application viewing mode request texture or not.
FBModel * GetFBModel()
Get Model.
unsigned int GetGeometryArrayIds() const
Get the geometry array ids for rendering.
KShaderModelInfo * GetShaderModelInfo() const
Get Internal ShaderModelInfo object.
FBMaterial * GetFBMaterial()
Get Material.
void SetGeometryArrayIds(unsigned int pArrayIds)
Get the geometry array ids for rendering.
int GetShaderVersion() const
GetLast updated shader version.
virtual void UpdateModelShaderInfo(int pShader_Version)
To be overloaded, always be called when Model or Shader version out of date.
int GetModelVersion() const
Get Last updated model version id.
Shader Shadow Live class.
FBShaderShadowLive(const char *pName, HIObject pObject=NULL)
Constructor.
FBPropertyListObject Lights
List: List of light object which will produce shadows.
FBPropertyListObject Models
List: List of object which when lighted will cast a shadow.
FBPropertyShadowFrameType ShadowFrameType
Read Write Property: Used to select the shadow calculation method.
FBPropertyShadowType ShadowType
Read Write Property: Indicate which shadow type is desired.
FBPropertyBool UseGobo
Read Write Property: Includes the gobo in the shadow map calculation.
FBPropertyBool LocalShadow
Read Write Property: Creates an accurate projection of a shadow for each object.
FBPropertyDouble ShadowZOffset
Read Write Property: Specifies the offset of the Live Shadow shader's plane from the original selecte...
FBPropertyAnimatableDouble ShadowIntensity
Read Write Property: Controls the darkness of shadows cast by a selected object.
Viewing options for rendering.
#define __FBClassDeclare(Name, Parent)
For internal use only.
Contains definitions for devices, boxes and models.
FB_DEFINE_COMPONENT(K_DLLIMPORT, AnimationNode)
Animation node class.
#define FBClassDeclare(Name, Parent)
Class declaration.
class K_DLLIMPORT FBPropertyBaseAnimatable< double, kFBPT_double > FBPropertyAnimatableDouble
FBPropertyBaseAnimatableDouble type definition.
class K_DLLIMPORT FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
#define FB_DEFINE_LIST(DllTag, Type)
Define a component list.
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
class K_DLLIMPORT FBPropertyBase< double, kFBPT_double > FBPropertyDouble
Property: double
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
FBAlphaSource
Shader transparency computation.
@ kFBAlphaSourceTransluscentZSortAlpha
Translucent(Models Z Sort).
@ kFBAlphaSourceNoAlpha
No transparency.
@ kFBAlphaSourceAccurateAlpha
Accurate Transparency.
@ kFBAlphaSourceAdditiveAlpha
Additive Transparency.
@ kFBAlphaSource2DTransparency
2D Transparency.
@ kFBAlphaSourceMatteAlpha
Matte.
@ kFBAlphaSourceTransluscentAlpha
Translucent.
FBShaderCapacity
Shader Capacity.
@ kFBShaderCapacityDrawInstanced
This shader can support GL_ARB_draw_instanced extension, and thus could benefit from Geometry instanc...
@ kFBShaderCapactiyDrawTextureLayer
This shader will able to draw additional texture layer (for example, live shadow or reflection).
@ kFBShaderCapacityMaterialEffect
This shader is acting as a material effect, should sitting behind the material central network,...
@ kFBShaderCapacityDrawShadow
This shader will able to draw different shape thus generate different shadow than original solid geom...
FBShaderPassActionCallback
Shader Pass Action Callback.
FBShadowType
Shadow types.
@ kFBShadowTypeShadowTranslucentPlanar
Use this shadow type to create darkened shadow areas only on planar surfaces.
@ kFBShadowTypeZLightMapProjectiveTexture
Similar to the Projective Light Map except that it uses a boolean algorithm to create a self-shadow.
@ kFBShadowTypeShadowOpaquePlanar
Similar to the Planar Shadow, except that it treats all objects as opaque.
@ kFBShadowTypeZShadowProjectiveTexture
Similar to the Projective Shadow, except that it uses a boolean algorithm to create a self-shadow.
@ kFBShadowTypeLightMapProjectiveTexture
Uses a texture projection as a shadow.
@ kFBShadowTypeShadowProjectiveTexture
Uses a texture projection to create a shadow.
FBRenderingPass
Rendering Pass.
@ kFBPassInvalid
No pass selected.
@ kFBPassMatte
Alpha > 0.5 will show up.
@ kFBPassPostRender
After everything.
@ kFBPassLighted
Lighting on.
@ kFBPassZTranslucentAlphaTest
Writes to depth buffer where Alpha > 0.5.
@ kFBPassPreRender
Before anything.
@ kFBPassZTranslucent
Writes to depth buffer.
@ kFBPassTranslucent
Models are blended.
@ kFBPassTranslucentZSort
Models are sorted and blended.
@ kFBPassFlat
Lighting off.
@ kFBPassAddColor
Models are blended additively.
FBShadowFrameType
Shadow calculation methods.
@ kFBShadowFrameTypeShadowCaster
Bases the shadow calculation on the shadow of the caster.
@ kFBShadowFrameTypeShadowReceiver
Bases the shadow calculation on the shadow of the receiver.
@ kFBShadowFrameTypeShadowCubeMap
Undocumented or unsupported.
FB_FORWARD(FBViewingOptions)
FBRenderOptions.
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.