Open Reality Reference Guide
fbshader.h File Reference

Declaration for the classes FBShaderManager, FBShader, FBPropertyListShader and other subclasses. More...

#include <kaydaradef.h>
#include <fbsdk/fbcomponent.h>
#include <fbsdk/fbcore.h>

Go to the source code of this file.

Classes

class  FBShaderManager
 Shader manager. More...
 
class  FBShaderModelInfo
 
class  FBRenderOptions
 
class  FBShader
 Shader class. More...
 
class  FBPropertyListShader
 PropertyList: Shader More...
 
class  FBShaderLighted
 Lighted shader class. More...
 
class  FBShaderShadowLive
 Shader Shadow Live class. More...
 

Macros

#define FBSDK_DLL   K_DLLIMPORT
 Be sure that FBSDK_DLL is defined only once... More...
 
#define FBRegisterShader(UniqueNameStr, ClassName, Label, Description, IconFilename)
 Shader class registration. More...
 
#define FBShaderDeclare(ClassName, Parent)
 Shader class declaration. More...
 
#define FBShaderImplementation(ThisComponent)    FBClassImplementation( ThisComponent )
 Shader class implementation. More...
 

Enumerations

enum  FBRenderingPass {
  kFBPassInvalid = 0,
  kFBPassPreRender = 1 << 0,
  kFBPassFlat = 1 << 1,
  kFBPassLighted = 1 << 2,
  kFBPassMatte = 1 << 3,
  kFBPassZTranslucent = 1 << 4,
  kFBPassZTranslucentAlphaTest = 1 << 5,
  kFBPassTranslucent = 1 << 6,
  kFBPassAddColor = 1 << 7,
  kFBPassTranslucentZSort = 1 << 8,
  kFBPassPostRender = 1 << 9
}
 Rendering Pass. More...
 
enum  FBAlphaSource {
  kFBAlphaSourceNoAlpha,
  kFBAlphaSourceAccurateAlpha,
  kFBAlphaSourceTransluscentAlpha,
  kFBAlphaSourceMatteAlpha,
  kFBAlphaSource2DTransparency,
  kFBAlphaSourceAdditiveAlpha,
  kFBAlphaSourceTransluscentZSortAlpha
}
 Shader transparency computation. More...
 
enum  FBShaderCapacity {
  kFBShaderCapacityNone = 0,
  kFBShaderCapacityMaterialEffect = 1 << 0,
  kFBShaderCapacityDrawInstanced = 1 << 1,
  kFBShaderCapacityDrawShadow = 1 << 2,
  kFBShaderCapactiyDrawTextureLayer = 1 << 3
}
 Shader Capacity. More...
 
enum  FBShaderPassActionCallback {
  kFBShaderPassActionNone = 0,
  kFBShaderPassTypeBegin = 1 << 0,
  kFBShaderPassTypeEnd = 1 << 1,
  kFBShaderPassInstanceBegin = 1 << 2,
  kFBShaderPassInstanceEnd = 1 << 3,
  kFBShaderPassMaterialBegin = 1 << 4,
  kFBShaderPassMaterialEnd = 1 << 5,
  kFBShaderPassGeometryBegin = 1 << 6,
  kFBShaderPassGeometryEnd = 1 << 7,
  kFBShaderPassModelsDraw = 1 << 8,
  kFBShaderPassModelDraw = 1 << 9
}
 Shader Pass Action Callback. More...
 
enum  FBShadowType {
  kFBShadowTypeShadowTranslucentPlanar,
  kFBShadowTypeShadowProjectiveTexture,
  kFBShadowTypeLightMapProjectiveTexture,
  kFBShadowTypeZShadowProjectiveTexture,
  kFBShadowTypeZLightMapProjectiveTexture,
  kFBShadowTypeShadowOpaquePlanar
}
 Shadow types. More...
 
enum  FBShadowFrameType {
  kFBShadowFrameTypeShadowReceiver,
  kFBShadowFrameTypeShadowCaster,
  kFBShadowFrameTypeShadowCubeMap
}
 Shadow calculation methods. More...
 

Functions

 K_FORWARD (KRenderOptions)
 
 K_FORWARD (KModelRenderInfo)
 
 K_FORWARD (KShaderModelInfo)
 
 FB_FORWARD (FBShaderManager)
 
 FB_FORWARD (FBShader)
 
 FB_FORWARD (FBMaterial)
 
 FB_FORWARD (FBCamera)
 
 FB_FORWARD (FBShaderModelInfo)
 
 FB_FORWARD (FBViewingOptions)
 FBRenderOptions. More...
 
 FB_FORWARD (FBRenderOptions)
 
 FB_DEFINE_ENUM (K_DLLIMPORT, RenderingPass)
 
 FB_DEFINE_ENUM (K_DLLIMPORT, AlphaSource)
 
 FB_DEFINE_ENUM (K_DLLIMPORT, ShaderCapacity)
 
 FB_DEFINE_ENUM (K_DLLIMPORT, ShaderPassActionCallback)
 
 FB_FORWARD (FBRenderer)
 
 __FB_FORWARD (FBShader)
 
 FB_DEFINE_COMPONENT (K_DLLIMPORT, Shader)
 
 FB_DEFINE_LIST (K_DLLIMPORT, Shader)
 
 FB_FORWARD (FBShaderLighted)
 
 FB_DEFINE_COMPONENT (K_DLLIMPORT, ShaderLighted)
 
 FB_FORWARD (FBShaderShadowLive)
 
 FB_DEFINE_COMPONENT (K_DLLIMPORT, ShaderShadowLive)
 
 FB_DEFINE_ENUM (K_DLLIMPORT, ShadowType)
 
 FB_DEFINE_ENUM (K_DLLIMPORT, ShadowFrameType)
 

Detailed Description

Declaration for the classes FBShaderManager, FBShader, FBPropertyListShader and other subclasses.

Definition in file fbshader.h.

Macro Definition Documentation

◆ FBRegisterShader

#define FBRegisterShader (   UniqueNameStr,
  ClassName,
  Label,
  Description,
  IconFilename 
)
Value:
HIObject RegisterShader##ClassName( HIObject /*pOwner*/,const char* pName,void * /*pData*/) \
{ \
ClassName *Class = new ClassName( pName ); \
Class->UniqueName = UniqueNameStr; \
Class->ShaderDescription = Description; \
if (Class->FBCreate()) { \
return Class->GetHIObject(); \
} else { \
delete Class; \
return NULL; \
} \
} \
FBLibraryModule( ClassName ) \
{ \
FBRegisterObject( ClassName##R1,"renderer/usershader/ogl",Label,Description,RegisterShader##ClassName,true, IconFilename ); \
FBRegisterObject( ClassName##R2,"FbxStorable/Shader",UniqueNameStr,Description,RegisterShader##ClassName,true, IconFilename ); \
}

Shader class registration.

Parameters
UniqueNameStrUnique name.
ClassNameShader class name.
LabelShort description.
DescriptionLong description.
IconFilenameName of the file containing the icon.

Definition at line 71 of file fbshader.h.

◆ FBSDK_DLL

#define FBSDK_DLL   K_DLLIMPORT

Be sure that FBSDK_DLL is defined only once...

Definition at line 50 of file fbshader.h.

◆ FBShaderDeclare

#define FBShaderDeclare (   ClassName,
  Parent 
)
Value:
FBClassDeclare( ClassName,Parent); \
public: \
ClassName(const char* pName):Parent(pName) { FBClassInit; } \
private:

Shader class declaration.

Parameters
ClassNameShader class name.
ParentClass parent.

Definition at line 94 of file fbshader.h.

◆ FBShaderImplementation

#define FBShaderImplementation (   ThisComponent)     FBClassImplementation( ThisComponent )

Shader class implementation.

Parameters
ThisComponentClass to implement.

Definition at line 103 of file fbshader.h.

Enumeration Type Documentation

◆ FBAlphaSource

Shader transparency computation.

There are different way to compute transparency, and this lists the supported options.

Enumerator
kFBAlphaSourceNoAlpha 

No transparency.

kFBAlphaSourceAccurateAlpha 

Accurate Transparency.

kFBAlphaSourceTransluscentAlpha 

Translucent.

kFBAlphaSourceMatteAlpha 

Matte.

kFBAlphaSource2DTransparency 

2D Transparency.

kFBAlphaSourceAdditiveAlpha 

Additive Transparency.

kFBAlphaSourceTransluscentZSortAlpha 

Translucent(Models Z Sort).

Definition at line 403 of file fbshader.h.

◆ FBRenderingPass

Rendering Pass.

Use with FBShader::RenderingPass properties to make the shader be called at any pass. Passes will be called in the order of the enum.

Enumerator
kFBPassInvalid 

No pass selected.

kFBPassPreRender 

Before anything.

kFBPassFlat 

Lighting off.

kFBPassLighted 

Lighting on.

kFBPassMatte 

Alpha > 0.5 will show up.

kFBPassZTranslucent 

Writes to depth buffer.

kFBPassZTranslucentAlphaTest 

Writes to depth buffer where Alpha > 0.5.

kFBPassTranslucent 

Models are blended.

kFBPassAddColor 

Models are blended additively.

kFBPassTranslucentZSort 

Models are sorted and blended.

kFBPassPostRender 

After everything.

Definition at line 384 of file fbshader.h.

◆ FBShaderCapacity

Shader Capacity.

Enumerator
kFBShaderCapacityMaterialEffect 

This shader is acting as a material effect, should sitting behind the material central network, only affect the same materail mapped regions of the whole model.

kFBShaderCapacityDrawInstanced 

This shader can support GL_ARB_draw_instanced extension, and thus could benefit from Geometry instancing when upload transformation matrix.

kFBShaderCapacityDrawShadow 

This shader will able to draw different shape thus generate different shadow than original solid geometry.

kFBShaderCapactiyDrawTextureLayer 

This shader will able to draw additional texture layer (for example, live shadow or reflection).

Definition at line 417 of file fbshader.h.

◆ FBShaderPassActionCallback

Shader Pass Action Callback.

ORSDK shader should request which pass action should be hooked up for callback.

Definition at line 430 of file fbshader.h.

◆ FBShadowFrameType

Shadow calculation methods.

Enumerator
kFBShadowFrameTypeShadowReceiver 

Bases the shadow calculation on the shadow of the receiver.

kFBShadowFrameTypeShadowCaster 

Bases the shadow calculation on the shadow of the caster.

kFBShadowFrameTypeShadowCubeMap 

Undocumented or unsupported.

Definition at line 823 of file fbshader.h.

◆ FBShadowType

Shadow types.

The different types of shadow mapping.

Enumerator
kFBShadowTypeShadowTranslucentPlanar 

Use this shadow type to create darkened shadow areas only on planar surfaces.

kFBShadowTypeShadowProjectiveTexture 

Uses a texture projection to create a shadow.

kFBShadowTypeLightMapProjectiveTexture 

Uses a texture projection as a shadow.

kFBShadowTypeZShadowProjectiveTexture 

Similar to the Projective Shadow, except that it uses a boolean algorithm to create a self-shadow.

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.

Definition at line 810 of file fbshader.h.

Function Documentation

◆ FB_FORWARD()

FB_FORWARD ( FBViewingOptions  )
FBClassDeclare
#define FBClassDeclare(Name, Parent)
Class declaration.
Definition: fbdefines.h:85
FBClassInit
#define FBClassInit
Class initialization.
Definition: fbdefines.h:64