GL Studio C++ Runtime API
GlsRenderEffect Class Referenceabstract

#include <gls_render_effect.h>

Inheritance diagram for GlsRenderEffect:
VertexAttribIndexLookup Effect_DiffNormSpecRefl Effect_DirectXShader

Classes

class  TextureSettings
 

Public Types

typedef bool(* DebugModeChangeCallback) (void *user, const char *modeName, bool value)
 
- Public Types inherited from VertexAttribIndexLookup
enum  AttributeSemanticEnum {
  ATTRIB_UNDEFINED = 0 , ATTRIB_POSITION = 0x80000000 , ATTRIB_NORMAL , ATTRIB_BLENDWEIGHT ,
  ATTRIB_TANGENT , ATTRIB_BINORMAL , ATTRIB_BLENDINDICES , ATTRIB_PSIZE ,
  ATTRIB_TEXCOORD0 , ATTRIB_TEXCOORD1 , ATTRIB_TEXCOORD2 , ATTRIB_TEXCOORD3 ,
  ATTRIB_TEXCOORD4 , ATTRIB_TEXCOORD5 , ATTRIB_TEXCOORD6 , ATTRIB_TEXCOORD7
}
 

Public Member Functions

virtual void AddRef ()=0
 Add to this object's reference count. More...
 
virtual void Release ()=0
 Release a reference to this object. More...
 
virtual unsigned int GlsRenderEffect_ClassID () const =0
 
virtual void SetupEffect (DynamicArray< Material > &materialPalette, TexturePalette *texturePalette, const TextureSettings &textureSettings, float *viewToWorld3x3, unsigned int maxLightNum, unsigned int activeLightMask)=0
 
virtual void CleanupEffect ()=0
 Remove the effect trom the OpenGL state. More...
 
virtual int Compare (const GlsRenderEffect *other) const =0
 
bool Equals (const GlsRenderEffect *other) const
 
virtual DistiAttribDictAttributes ()=0
 
virtual const std::string & EffectTypeName ()=0
 
virtual GlsRenderEffectClone () const =0
 
virtual void GetReferencedMaterials (ReferencedMaterialArray &referencedMaterials)
 
virtual void GetReferencedTextures (ReferencedTextureArray &referencedTextures)
 
- Public Member Functions inherited from VertexAttribIndexLookup
virtual GLint GetVertexAttribIndexForSemantic (int semanticEnum)=0
 

Static Public Member Functions

static unsigned int SetDebugMode (const char *modeName, bool value)
 
static unsigned int RegisterNewClassID (const char *debugStr=NULL)
 
static bool RegisterDebugModeChangeCallback (void *param, DebugModeChangeCallback func)
 
static bool UnregisterDebugModeChangeCallback (void *param, DebugModeChangeCallback func)
 

Detailed Description

Abstract render effect class Encapsulates an effect that can be applied to the OpenGL state to modify the appearance of geometry. This API currently only supports single pass techniques.

Member Typedef Documentation

◆ DebugModeChangeCallback

typedef bool(* DebugModeChangeCallback) (void *user, const char *modeName, bool value)

Typedef for DebugMode change callbacks.

See also
RegisterDebugModeChangeCallback
Parameters
userPointer that was provided when the callback was registered.
modeNameName of the mode that is changing.
valueTrue to enable the mode, false to disable.
returnsTrue if the callback recognized the mode change, false otherwise.

Member Function Documentation

◆ AddRef()

virtual void AddRef ( )
pure virtual

Add to this object's reference count.

Implemented in Effect_DiffNormSpecRefl, and Effect_DirectXShader.

◆ Attributes()

virtual DistiAttribDict & Attributes ( )
pure virtual
Returns
A reference to the attribute dictionary for this object.

Implemented in Effect_DiffNormSpecRefl, and Effect_DirectXShader.

◆ CleanupEffect()

virtual void CleanupEffect ( )
pure virtual

Remove the effect trom the OpenGL state.

Implemented in Effect_DiffNormSpecRefl, and Effect_DirectXShader.

◆ Clone()

virtual GlsRenderEffect * Clone ( ) const
pure virtual
Returns
A new instance of the effect with the same settings as this one.

Implemented in Effect_DiffNormSpecRefl, and Effect_DirectXShader.

◆ Compare()

virtual int Compare ( const GlsRenderEffect other) const
pure virtual
Returns
0 if the effects are equal, a positive number if this effect should sort after the other effect, or a negative number if this effect should sort before the other effect. The rendering system uses this to sort effects.
Parameters
otherThe effect to compare with.

Implemented in Effect_DiffNormSpecRefl, and Effect_DirectXShader.

◆ EffectTypeName()

virtual const std::string & EffectTypeName ( )
pure virtual
Returns
The human readable type name associated with this effect.

Implemented in Effect_DiffNormSpecRefl, and Effect_DirectXShader.

◆ Equals()

bool Equals ( const GlsRenderEffect other) const
inline

Determine if two GlsRenderEffect instances are equivalent The rendering system uses this to eliminate redundant effects.

Parameters
otherThe effect to compare with.
Returns
True if the compared effects are equivalent.

◆ GetReferencedMaterials()

virtual void GetReferencedMaterials ( ReferencedMaterialArray referencedMaterials)
inlinevirtual

Checks whether or not the effect is transparent. Implementing is optional Inserts all referenced textures into the array passed in. Implementing is optional.

Parameters
referencedMaterialsA returned array of material indices.

Reimplemented in Effect_DiffNormSpecRefl.

◆ GetReferencedTextures()

virtual void GetReferencedTextures ( ReferencedTextureArray referencedTextures)
inlinevirtual

Inserts all referenced textures into the array passed in. Implementing is optional.

Parameters
referencedTexturesA returned array of texture indices.

Reimplemented in Effect_DiffNormSpecRefl.

◆ GlsRenderEffect_ClassID()

virtual unsigned int GlsRenderEffect_ClassID ( ) const
pure virtual

Allows for static casting in compare functions

See also
RegisterNewClassID
Returns
A unique identifier associated with this effect type.

Implemented in Effect_DiffNormSpecRefl, and Effect_DirectXShader.

◆ RegisterDebugModeChangeCallback()

static bool RegisterDebugModeChangeCallback ( void *  param,
DebugModeChangeCallback  func 
)
static

Register for debug mode change notifications.

Note
Be sure to also Unregister!
See also
UnregisterDebugModeChangeCallback
Parameters
paramUser pointer that will be passed to the callback.
funcPointer to the callback function.
Returns
True on success.

◆ RegisterNewClassID()

static unsigned int RegisterNewClassID ( const char *  debugStr = NULL)
static
Returns
A new ClassID. Typically only called once by each GlsRenderEffect implementation.
Parameters
debugStrUnused, kept for backward compatibility.

◆ Release()

virtual void Release ( )
pure virtual

Release a reference to this object.

Implemented in Effect_DiffNormSpecRefl, and Effect_DirectXShader.

◆ SetDebugMode()

static unsigned int SetDebugMode ( const char *  modeName,
bool  value 
)
static

Enable / Disable a debug mode for all effects that support it.

Parameters
modeNameName of the mode to enable / disable.
valueTrue to enable the mode, false to disable.
Returns
The number of effect callbacks that recognized the mode change.

◆ SetupEffect()

virtual void SetupEffect ( DynamicArray< Material > &  materialPalette,
TexturePalette texturePalette,
const TextureSettings textureSettings,
float *  viewToWorld3x3,
unsigned int  maxLightNum,
unsigned int  activeLightMask 
)
pure virtual

Apply the effect to the OpenGL state

Parameters
materialPaletteUsed to access material settings
texturePaletteUsed to access texture maps
textureSettingsThe object-level texture settings
viewToWorld3x3A 3x3 matrix containing the current viewToWorld transfrom. Used for environment mapping effects.
maxLightNumThe number of active lights in the scene. Used to speed up light calculations.
activeLightMaskA bit mask of which lights are active in the scene (Ex. GL_LIGHT0, GL_LIGHT2, GL_LIGHT3 and GL_LIGHT7 are active: activeLightMask = ...10001101 last 8 bits in binary = 141u)

Implemented in Effect_DiffNormSpecRefl, and Effect_DirectXShader.

◆ UnregisterDebugModeChangeCallback()

static bool UnregisterDebugModeChangeCallback ( void *  param,
DebugModeChangeCallback  func 
)
static

Unregister for debug mode change notifications. The parameters must match those that were passed when the callback was registered.

See also
RegisterDebugModeChangeCallback
Parameters
paramUser pointer that was passed to RegisterDebugModeChangeCallback.
funcFunction pointer that was passed to RegisterDebugModeChangeCallback.
Returns
True if the callback was found and unregistered.

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