GL Studio C++ Runtime API
Effect_DirectXShader Class Reference

#include <effect_directx_shader.h>

Inheritance diagram for Effect_DirectXShader:
GlsRenderEffect VertexAttribIndexLookup

Public Types

typedef std::map< std::string, float > FloatParamsT
 Typedef for a map between strings and floats.
 
typedef std::map< std::string, int > IntParamsT
 Typedef for a map between strings and ints.
 
typedef std::map< std::string, GlsColorColorParamsT
 Typedef for a map between strings and Colors.
 
typedef std::map< std::string, VectorVectorParamsT
 Typedef for a map between strings and Vectors.
 
typedef std::map< std::string, bool > BoolParamsT
 Typedef for a map between strings and bools.
 
- Public Types inherited from GlsRenderEffect
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

 Effect_DirectXShader (const Effect_DirectXShader &)
 Copy constructor.
 
const Effect_DirectXShaderoperator= (const Effect_DirectXShader &)
 
bool operator== (const Effect_DirectXShader &) const
 
bool operator!= (const Effect_DirectXShader &o) const
 
void SetMaterialIndex (unsigned int materialIndex)
 
unsigned int GetMaterialIndex () const
 
void SelectShader ()
 
DistiAttribDictAttributes () DISTI_METHOD_OVERRIDE
 
const std::string & EffectTypeName () DISTI_METHOD_OVERRIDE
 
virtual GLint GetVertexAttribIndexForSemantic (int semanticEnum) DISTI_METHOD_OVERRIDE
 
virtual void AddRef () DISTI_METHOD_OVERRIDE
 Add to this object's reference count. More...
 
virtual void Release () DISTI_METHOD_OVERRIDE
 Release a reference to this object. More...
 
virtual unsigned int GlsRenderEffect_ClassID () const DISTI_METHOD_OVERRIDE
 
virtual void SetupEffect (DynamicArray< Material > &materialPalette, TexturePalette *texturePalette, const TextureSettings &textureSettings, float *viewToWorld3x3, unsigned int maxLightNum, unsigned int activeLightMask) DISTI_METHOD_OVERRIDE
 
virtual void CleanupEffect () DISTI_METHOD_OVERRIDE
 Remove the effect trom the OpenGL state. More...
 
virtual int Compare (const GlsRenderEffect *) const DISTI_METHOD_OVERRIDE
 
virtual GlsRenderEffectClone () const DISTI_METHOD_OVERRIDE
 
- Public Member Functions inherited from GlsRenderEffect
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)
 
virtual GLint GetVertexAttribIndexForSemantic (int semanticEnum)=0
 

Public Attributes

FilePathClass_effectScriptPath
 File path to the script for this effect.
 
FloatParamsT _floatParams
 Float parameter storage.
 
IntParamsT _intParams
 Int parameter storage.
 
ColorParamsT _colorParams
 Color parameter storage.
 
VectorParamsT _vectorParams
 Vector parameter storage.
 
BoolParamsT _boolParams
 Bool parameter storage.
 
IntParamsT _texture2DIndexParams
 2D texture parameter storage.
 
IntParamsT _textureCUBEIndexParams
 Cube map parameter storage.
 

Static Public Attributes

static const std::string EFFECT_TYPE_NAME
 Backing storage for the human readable string for this effect type.
 
static const int INVALID_INDEX = -1
 Value to represent an invalid texture index.
 

Protected Member Functions

void SetupHelperEffect ()
 
void SetupAttribDict ()
 

Protected Attributes

unsigned int _ref_count
 Reference count.
 
unsigned int _materialIndex
 The material index to use.
 
Effect_DiffNormSpecRefl_helperEffect
 
DistiAttribDict_attribDict
 The attribute dictionary for this object.
 

Additional Inherited Members

- Static Public Member Functions inherited from GlsRenderEffect
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

Render effect that supports DirectX effect scripts. This will not render anything special in the Editor or in the GLStudio runtime; it only holds the effect configuration for processing by the Lumen converter/generator.

Deprecated:
The Lumen code generator is deprecated.

Member Function Documentation

◆ AddRef()

virtual void AddRef ( )
virtual

Add to this object's reference count.

Implements GlsRenderEffect.

◆ Attributes()

DistiAttribDict & Attributes ( )
inlinevirtual
Returns
A reference to the effect attribute dictionary.

Implements GlsRenderEffect.

◆ CleanupEffect()

virtual void CleanupEffect ( )
virtual

Remove the effect trom the OpenGL state.

Implements GlsRenderEffect.

◆ Clone()

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

Implements GlsRenderEffect.

◆ Compare()

virtual int Compare ( const GlsRenderEffect other) const
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.

Implements GlsRenderEffect.

◆ EffectTypeName()

const std::string & EffectTypeName ( )
inlinevirtual
Returns
This effect's type as a readable string.

Implements GlsRenderEffect.

◆ GetMaterialIndex()

unsigned int GetMaterialIndex ( ) const
inline
Returns
The current material index for this effect.

◆ GetVertexAttribIndexForSemantic()

virtual GLint GetVertexAttribIndexForSemantic ( int  semanticEnum)
virtual
Returns
The attributeIndex that should be used to pass the vertex attributes or -1 if they are not needed (see glVertexAttrib)
Parameters
semanticEnumThe sematic value (see AttributeSemanticEnum)

Implements VertexAttribIndexLookup.

◆ GlsRenderEffect_ClassID()

virtual unsigned int GlsRenderEffect_ClassID ( ) const
virtual

Allows for static casting in compare functions

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

Implements GlsRenderEffect.

◆ operator!=()

bool operator!= ( const Effect_DirectXShader o) const
inline

Inequality operator

Parameters
oThe object to compare to.
Returns
Whether or not the objects are not the same.

◆ operator=()

const Effect_DirectXShader & operator= ( const Effect_DirectXShader )

Assignment operator

Returns
The resulting object (this).

◆ operator==()

bool operator== ( const Effect_DirectXShader ) const

Equality operator

Returns
Whether or not the objects are the same.

◆ Release()

virtual void Release ( )
virtual

Release a reference to this object.

Implements GlsRenderEffect.

◆ SelectShader()

void SelectShader ( )

Selects the shader to use based on the current effect parameters.

Note
Not normally called by users.

◆ SetMaterialIndex()

void SetMaterialIndex ( unsigned int  materialIndex)
inline

Set the material index for this effect.

Parameters
materialIndexThe new material index for this effect.

◆ SetupAttribDict()

void SetupAttribDict ( )
protected

Called to add this object's attributes to the dictionary.

Note
Not normally called by users.

◆ SetupEffect()

virtual void SetupEffect ( DynamicArray< Material > &  materialPalette,
TexturePalette texturePalette,
const TextureSettings textureSettings,
float *  viewToWorld3x3,
unsigned int  maxLightNum,
unsigned int  activeLightMask 
)
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)

Implements GlsRenderEffect.

◆ SetupHelperEffect()

void SetupHelperEffect ( )
protected

Sets up _helperEffect.

Note
Not normally called by users

Member Data Documentation

◆ _helperEffect

Effect_DiffNormSpecRefl* _helperEffect
protected

Used for rendering the object in the editor; we'll just set up a basic grey


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