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