My Project
Public Types | Public Member Functions | List of all members
ParaEngine::EffectManager Class Reference

manager all effects file used by the game engine. More...

#include <EffectManager.h>

Inheritance diagram for ParaEngine::EffectManager:
ParaEngine::AssetManager< CEffectFile > ParaEngine::IAttributeFields ParaEngine::IObject ParaEngine::CRefCounted

Public Types

enum  VERTEX_DECLARATION {
  S0_POS_TEX0, S0_POS_NORM_TEX0, S0_POS_NORM_TEX0_INSTANCED, S0_POS_TEX0_COLOR,
  S0_POS_NORM_TEX0_COLOR, S0_S1_S2_OCEAN_FFT, S0_S1_S2_S3_OCEAN_FFT, S0_POS_NORM_TEX0_TEX1,
  S0_POS_TEX0_TEX1, S0_S1_OCEAN_CLOUD, S0_POS_COLOR, S0_POS2_COLOR,
  S0_POS_NORM_COLOR, S0_POS_NORM_TEX0_COLOR0_COLOR1, S0_POS, MAX_DECLARATIONS_NUM
}
 predefined vertex declaration. More...
 
enum  EffectTechniques { EFFECT_DEFAULT = 0, EFFECT_GEN_SHADOWMAP, EFFECT_RENDER_WITH_SHADOWMAP, EFFECT_FIXED_FUNCTION }
 
enum  ClipPlaneState { ClipPlane_Disabled, ClipPlane_Enabled_WorldSpace, ClipPlane_Enabled_ClipSpace }
 clip plane state
 
- Public Types inherited from ParaEngine::AssetManager< CEffectFile >
typedef AssetManager< CEffectFile, CEffectFile, AssetEntityMyType_t
 
typedef std::map< std::string, AssetEntity *> AssetItemsNameMap_t
 
typedef std::map< AssetKey, AssetEntity *> AssetItemsSet_t
 
- Public Types inherited from ParaEngine::IAttributeFields
typedef ParaEngine::weak_ptr< IObject, IAttributeFieldsWeakPtr_type
 
- Public Types inherited from ParaEngine::IObject
typedef ParaEngine::weak_ptr< IObjectWeakPtr_type
 

Public Member Functions

CEffectFileGetEffectByHandle (int nHandle)
 Return the effect object by its handle. More...
 
int GetEffectHandle (CEffectFile *effectFile)
 Get the integer handle to this asset. More...
 
CEffectFileGetEffectByName (const string &sName)
 the returned effect may not be valid. More...
 
CEffectFileMapHandleToEffect (int nHandle, CEffectFile *pNewEffect)
 Map a nHandle to effect object. More...
 
virtual bool DeleteEntity (AssetEntity *entity)
 decrease the reference count on the entity, and if it is negative, the asset will be unloaded. More...
 
virtual void InitDeviceObjects ()
 
virtual void DeleteDeviceObjects ()
 
virtual void RestoreDeviceObjects ()
 
virtual void InvalidateDeviceObjects ()
 
virtual void RendererRecreated ()
 callback of listening the event that renderer was recreated on Android/WP8 all opengl related id has already become invalid at this time, no need to release them, just recreate them all in this function.
 
void Cleanup ()
 delete all asset item from memory. More...
 
CShadowMapGetShadowMap ()
 get the shadow map object. More...
 
CGlowEffectGetGlowEffect ()
 get the glow effect object. More...
 
bool BeginEffect (int nHandle, CEffectFile **pOutEffect=NULL)
 Start effect by handle. More...
 
void EndEffect ()
 end the effect,this function actually does nothing. More...
 
CEffectFileCheckLoadEffect (int nHandle)
 get a valid effect. More...
 
VertexDeclarationPtr GetVertexDeclaration (int nIndex)
 Get declaration by id. More...
 
HRESULT SetVertexDeclaration (int nIndex)
 Set declaration by id. More...
 
void SetDefaultEffectMapping (int nLevel)
 load the default handle to effect file mapping. More...
 
int GetDefaultEffectMapping ()
 
void SetAllEffectsTechnique (EffectTechniques nTech)
 set all effect files to a specified technique.If the effect does not have the specified technique nothing will be changed. More...
 
EffectTechniques GetCurrentEffectTechniqueType ()
 current technique in the effect file
 
int GetCurrentTechHandle ()
 
CEffectFileGetCurrentEffectFile ()
 
HRESULT SetMaterial (ParaMaterial *pMaterial)
 
HRESULT SetLight (DWORD Index, const Para3DLight *pLight)
 
HRESULT LightEnable (DWORD Index, BOOL Enable)
 
HRESULT SetRenderState (D3DRENDERSTATETYPE State, DWORD Value)
 
HRESULT SetTexture (DWORD Stage, DeviceTexturePtr_type pTexture)
 
HRESULT SetSamplerState (int nStage, DWORD dwType, DWORD dwValue, bool bForceSet=false)
 internally it will cache texture stage to prevent direct d3d calls
 
HRESULT GetSamplerState (int nStage, DWORD dwType, DWORD *pValue, bool bForceGet=false)
 internally it will cache texture stage to prevent direct d3d calls
 
void SetDefaultSamplerState (int nStage, DWORD dwType, DWORD dwValue)
 default sampler state. More...
 
DWORD GetDefaultSamplerState (int nStage, DWORD dwType)
 default sampler state. More...
 
HRESULT SetTransform (D3DTRANSFORMSTATETYPE State, const Matrix4 *pMatrix)
 
HRESULT GetTransform (D3DTRANSFORMSTATETYPE State, Matrix4 *pMatrix)
 
const Matrix4GetWorldTransform ()
 Get the current world transformation matrix which is used by the effect. More...
 
const Matrix4GetViewTransform ()
 
const Matrix4GetProjTransform ()
 
void UpdateD3DPipelineTransform (bool pWorld, bool pView, bool pProjection)
 update the transformation for both the fixed and programmable pipeline. More...
 
void EnableFog (bool bEnabled)
 enable or disable fog. More...
 
void EnableClipPlane (bool bEnable)
 enable or disable user clip planes. More...
 
void EnableClipPlaneImmediate (EffectManager::ClipPlaneState newState, int nIndex=0)
 immediately change the device's clip plane settings if and only if it is different from the current setting. More...
 
bool IsClipPlaneEnabled ()
 whether the clip plane is enabled
 
void SetClipPlane (DWORD Index, const float *pPlane, bool bClipSpace)
 Sets the coefficients of a user-defined clipping plane for the device. More...
 
void applySurfaceMaterial (const ParaMaterial *pSurfaceMaterial, bool bUseGlobalAmbient=true)
 both Fixed function (FF) pipeline and the programmable pipeline can call this function. More...
 
void applyLocalLightingData (const LightList *lights, int nLightNum)
 both Fixed function (FF) pipeline and the programmable pipeline can call this function.
 
void applyLocalLightingData ()
 both Fixed function (FF) pipeline and the programmable pipeline can call this function. More...
 
void applyFogParameters ()
 automatically apply fog. More...
 
void applyObjectLocalLighting (CBaseObject *pObj)
 automatically apply local lighting to a scene object according to the bounding volume of the object. More...
 
void EnableGlobalLighting (bool bEnable)
 enable global sun lighting. More...
 
bool IsGlobalLightingEnabled ()
 whether global lighting is enabled. More...
 
void EnableLocalLighting (bool bEnable)
 enable lighting. More...
 
bool IsLocalLightingEnabled ()
 whether lighting is enabled. More...
 
void EnableUsingShadowMap (bool bEnable)
 enable shadow map
 
bool IsUsingShadowMap ()
 whether shadow map is enabled
 
const Matrix4GetTexViewProjMatrix ()
 get the shadow map's tex view projection matrix
 
void EnableTextures (bool bEnable)
 one occasion to disable textures is during the shadow pass. More...
 
bool AreTextureEnabled ()
 
void DisableD3DAlphaTesting (bool bDisable)
 
bool IsD3DAlphaTestingDisabled ()
 return true, if the alpha testing have been disabled. More...
 
void DisableD3DCulling (bool bDisable)
 
bool IsD3DCullingDisabled ()
 return true, if the alpha testing have been disabled. More...
 
void DisableZWrite (bool bDisable)
 disable z write. More...
 
bool IsZWriteDisabled ()
 return true, if the alpha testing have been disabled. More...
 
void EnableZWrite (bool bZWriteEnabled)
 this function only takes effects when IsZWriteDisabled() is false. More...
 
void EnableD3DAlphaBlending (bool bEnable)
 enable the D3D device's blending state
 
void EnableZTest (bool bEnable, bool bForceSet=false)
 enable ztest
 
bool IsZTestEnabled ()
 return true, if the alpha testing have been disabled. More...
 
void SetCullingMode (DWORD dwCullMode)
 set the culling mode of the current effect file or the fixed function pipeline. More...
 
void SetCullingMode (bool bEnable)
 
bool SetD3DFogState ()
 set d3d fog for the fixed function pipeline. More...
 
bool IsUsingFullScreenGlow ()
 whether full screen glow effect is used. More...
 
void EnableFullScreenGlow (bool bEnable)
 whether full screen glow effect is used. More...
 
bool IsReflectionRenderingEnabled ()
 disable reflection texture, this is used when rendering in to reflection texture
 
void EnableReflectionRendering (bool bEnabled)
 disable reflection texture, this is used when rendering in to reflection texture
 
void SetGlowTechnique (int nTech)
 set the glow technique More...
 
int GetGlowTechnique ()
 Get the glow technique. More...
 
void SetGlowness (const Vector4 &Glowness)
 glowness controls the intensity of the glow in the full screen glow effect. More...
 
const Vector4GetGlowness ()
 glowness controls the intensity of the glow in the full screen glow effect. More...
 
WaveEffectGetScreenWaveEffect ()
 
bool IsUsingScreenWaveEffect ()
 
void EnableScreenWaveEffect (bool enable)
 
void SetScreenWaveTechnique (int nTech)
 
int GetScreenWaveTechnique ()
 
void SetMaxLocalLightsNum (int nNum)
 set maximum number of local lights per object. More...
 
int GetMaxLocalLightsNum ()
 get maximum number of local lights per object. More...
 
ISceneGetScene ()
 which scene object the effect manager is current serving
 
void SetScene (IScene *pScene)
 which scene object the effect manager is current serving
 
bool IsCurrentEffectValid ()
 if the last call to BeginEffect() returns false, this function will be set to false. More...
 
- Public Member Functions inherited from ParaEngine::AssetManager< CEffectFile >
 ATTRIBUTE_DEFINE_CLASS (AssetManager)
 
virtual IAttributeFieldsGetChildAttributeObject (const std::string &sName)
 get attribute by child object. More...
 
virtual IAttributeFieldsGetChildAttributeObject (int nRowIndex, int nColumnIndex=0)
 
virtual int GetChildAttributeObjectCount (int nColumnIndex=0)
 get the number of child objects (row count) in the given column. More...
 
virtual int GetChildAttributeColumnCount ()
 we support multi-dimensional child object. More...
 
virtual const std::string & GetIdentifier ()
 
virtual void SetIdentifier (const std::string &sName)
 
void GetLowerCaseString (std::string &outNameLowered, const AssetKey &key)
 get the lower cased key string.
 
void DeleteByName (const std::string &name)
 delete the object by user specified name. More...
 
CEffectFileGetByName (const std::string &name)
 check if there is a object with a specified name, and return the pointer to it. More...
 
AssetEntityget (const AssetKey &key)
 check if there is a object with a specified asset key, and return the pointer to it. More...
 
CEffectFileNewEntity (const AssetKey &key)
 just create the entity instance without adding to the manager. More...
 
bool AddEntity (const std::string &name, CEffectFile *pEntity)
 insert entity to the manager. More...
 
pair< CEffectFile *, bool > CreateEntity (const string &name, const AssetKey &key)
 Create a new entity object and add it to the manager. More...
 
CEffectFileGetEntity (const string &name)
 get the entity by its entity key name
 
void LoadAsset ()
 initialize all assets created so far to accelerate loading during game play. More...
 
void UnloadAsset ()
 uninitialize all assets created so far to save some memory
 
void GarbageCollectAll ()
 Garbage Collect(free resources of) all unused entity. More...
 
bool CheckRefresh (const std::string &sEntityName)
 check if the entity exist, if so call Refresh(). More...
 
virtual int PrintToFile (CParaFile *pOutputFile)
 print all asset file to a given file. More...
 
- Public Member Functions inherited from ParaEngine::IAttributeFields
virtual int GetAttributeClassID ()
 attribute class ID should be identical, unless one knows how overriding rules work. More...
 
virtual const char * GetAttributeClassName ()
 a static string, describing the attribute class object's name
 
virtual const char * GetAttributeClassDescription ()
 a static string, describing the attribute class object
 
virtual int InstallFields (CAttributeClass *pClass, bool bOverride)
 this class should be implemented if one wants to add new attribute. More...
 
 ATTRIBUTE_METHOD1 (IAttributeFields, GetName_s, const char **)
 
 ATTRIBUTE_METHOD1 (IAttributeFields, SetName_s, const char *)
 
 ATTRIBUTE_METHOD (IAttributeFields, PrintObject_s)
 
 ATTRIBUTE_METHOD (IAttributeFields, AddRef_s)
 
 ATTRIBUTE_METHOD1 (IAttributeFields, GetRefCount_s, int *)
 
 ATTRIBUTE_METHOD1 (IAttributeFields, SetTime_s, int)
 
 ATTRIBUTE_METHOD1 (IAttributeFields, GetTime_s, int *)
 
 ATTRIBUTE_METHOD (IAttributeFields, Release_s)
 
virtual bool IsModified ()
 whether some of the fields are modified.It is up to the implementation class to provide this functionality if necessary. More...
 
virtual void SetModified (bool bModified)
 set whether any field has been modified. More...
 
virtual bool ValidateFields ()
 validate all fields and return true if validation passed. More...
 
virtual string GetValidationMessage ()
 get the recent validation message due to the most recent call to ValidateFields()
 
virtual bool ResetField (int nFieldID)
 Reset the field to its initial or default value. More...
 
virtual bool InvokeEditor (int nFieldID, const std::string &sParameters)
 Invoke an (external) editor for a given field. More...
 
virtual bool AddChildAttributeObject (IAttributeFields *pChild, int nRowIndex=-1, int nColumnIndex=0)
 add child object. More...
 
virtual void * QueryObjectByName (const std::string &sObjectType)
 convert to object of a given type. More...
 
virtual void * QueryObject (int nObjectType)
 convert to object of a given type. More...
 
virtual int GetTime ()
 get the current local time in case it is animated in milli seconds frames. More...
 
virtual void SetTime (int nTime)
 
virtual CDynamicAttributeFieldGetDynamicField (const std::string &sName)
 Get a dynamic field with a given name. More...
 
virtual CDynamicAttributeFieldGetDynamicField (int nIndex)
 Get a dynamic field with a given index. More...
 
virtual const char * GetDynamicFieldNameByIndex (int nIndex)
 get field name by index
 
virtual int GetDynamicFieldCount ()
 how many dynamic field this object currently have. More...
 
virtual int SetDynamicField (const std::string &sName, const CVariable &value)
 set a dynamic field with a given name. More...
 
virtual int AddDynamicField (const std::string &sName, ATTRIBUTE_FIELDTYPE dwType)
 add dynamic field and return field index
 
virtual void RemoveAllDynamicFields ()
 remove all dynamic fields
 
virtual int SaveDynamicFieldsToString (std::string &output)
 save only text dynamic fields to fieldname = value text strings. More...
 
virtual int LoadDynamicFieldsFromString (const std::string &input)
 load only text dynamic fields from string More...
 
CAttributeClassGetAttributeClass ()
 get the main attribute class object. More...
 
void PrintObject ()
 print the content of this object to a text file at temp/doc/[ClassName].txt. More...
 
- Public Member Functions inherited from ParaEngine::IObject
virtual void Clone (IObject *obj) const
 Clone the object's contains to a pointer. More...
 
virtual IObjectClone () const
 Clone the object's contains and return a pointer to the newly created object. More...
 
virtual bool Equals (const IObject *obj) const
 Compare the object with another object. More...
 
virtual const ITypeGetType () const
 
virtual std::string ToString () const
 
WeakPtr_typeGetWeakReference ()
 get weak reference object. More...
 
virtual int ProcessObjectEvent (const ObjectEvent &event)
 this function is only used to backward compatibility of ParaObject:AddEvent() function. More...
 
- Public Member Functions inherited from ParaEngine::CRefCounted
void addref () const
 add reference count of the object. More...
 
bool delref () const
 decrease reference count of the object. More...
 
int GetRefCount () const
 get the reference count
 
virtual int Release ()
 
CRefCountedAddToAutoReleasePool ()
 addref and releases the ownership sometime soon automatically (usually at the end of the current frame). More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ParaEngine::AssetManager< CEffectFile >
static MyType_tGetInstance ()
 
- Static Public Member Functions inherited from ParaEngine::IAttributeFields
static HRESULT GetAttributeClassID_s (IAttributeFields *cls, int *p1)
 
static HRESULT GetAttributeClassName_s (IAttributeFields *cls, const char **p1)
 
static bool OpenWithDefaultEditor (const char *sFilename, bool bWaitOnReturn=false)
 Open a given file with the default registered editor in the game engine. More...
 
- Public Attributes inherited from ParaEngine::AssetManager< CEffectFile >
std::string m_sName
 identifier
 
AssetItemsNameMap_t m_names
 human readable name of asset object, which can be used as key to retrieve entity from its manager Internally we use the key object to uniquely identify an assset.SIdentifer can be nil.
 
AssetItemsSet_t m_items
 A set of all asset entities.
 
AssetItemsNameMap_t m_lowercase_item_maps
 mapping from lower cased AssetKey to asset entity.
 
- Protected Member Functions inherited from ParaEngine::IAttributeFields
virtual CAttributeClassCreateAttributeClass ()
 initialize fields
 
virtual CDynamicAttributesSetGetDynamicAttributes (bool bCreateIfNotExist=false)
 
- Protected Attributes inherited from ParaEngine::IObject
WeakPtr_type m_weak_reference
 
- Protected Attributes inherited from ParaEngine::CRefCounted
int m_refcount
 

Detailed Description

manager all effects file used by the game engine.

Member Enumeration Documentation

§ EffectTechniques

Enumerator
EFFECT_DEFAULT 

normal rendering

EFFECT_GEN_SHADOWMAP 

shadow map generation technique

EFFECT_RENDER_WITH_SHADOWMAP 

rendering the model with shadow map

EFFECT_FIXED_FUNCTION 

fixed function pipeline

§ VERTEX_DECLARATION

predefined vertex declaration.

Member Function Documentation

§ applyFogParameters()

void EffectManager::applyFogParameters ( )

automatically apply fog.

this function only works on programmable pipeline.

§ applyLocalLightingData()

void EffectManager::applyLocalLightingData ( )

both Fixed function (FF) pipeline and the programmable pipeline can call this function.

using the last GetBestLights() results from the light manager.

§ applyObjectLocalLighting()

void EffectManager::applyObjectLocalLighting ( CBaseObject pObj)

automatically apply local lighting to a scene object according to the bounding volume of the object.

§ applySurfaceMaterial()

void EffectManager::applySurfaceMaterial ( const ParaMaterial pSurfaceMaterial,
bool  bUseGlobalAmbient = true 
)

both Fixed function (FF) pipeline and the programmable pipeline can call this function.

in most cases, this function is called by FF. The PF contains a same function in the effect file class.

Parameters
bUseGlobalAmbientif true and that the ambient in pSurfaceMaterial is 0, the ambient in the material is ignored. and the scene's ambient color will be used.

§ BeginEffect()

bool EffectManager::BeginEffect ( int  nHandle,
CEffectFile **  pOutEffect = NULL 
)

Start effect by handle.

It set the proper technique of the effect. the vertex declaration will also be set or created.

Parameters
nHandlethe effect handle.
pOutEffectpointer to retrieve the effect object which is currently selected.
Returns
: return true if succeeded.

§ CheckLoadEffect()

CEffectFile * EffectManager::CheckLoadEffect ( int  nHandle)

get a valid effect.

but it does not begin it. this function can be used to check if an effect file is supported on the current system

§ Cleanup()

void EffectManager::Cleanup ( )
virtual

delete all asset item from memory.

They can never be used again. instead, they must be recreated to use.

clean up items

Reimplemented from ParaEngine::AssetManager< CEffectFile >.

§ DeleteEntity()

bool EffectManager::DeleteEntity ( AssetEntity entity)
virtual

decrease the reference count on the entity, and if it is negative, the asset will be unloaded.

CAUTION: be sure that there is no named asset referencing this asset before calling this function. because the point to the asset will be invalid after this call.So use UnloadAsset(), if one just wants to temporarily remove the asset. return: return true, if the reference count is negative and that object is deleted from the memory, otherwise false.

Note
: it does not delete name mapping. To delete a named entity, please use DeleteByName()

Reimplemented from ParaEngine::AssetManager< CEffectFile >.

§ DisableD3DAlphaTesting()

void EffectManager::DisableD3DAlphaTesting ( bool  bDisable)
Parameters
bDisableif true, setting the alpha testing parameter of the effect files will not affect the d3d render state, only shader parameters are set.

§ DisableD3DCulling()

void EffectManager::DisableD3DCulling ( bool  bDisable)
Parameters
bDisableif true, setting the culling mode of the effect files will not affect the d3d render state, only shader parameters are set.

§ DisableZWrite()

void EffectManager::DisableZWrite ( bool  bDisable)

disable z write.

Any subsequent calls will be disabled.

§ EnableClipPlane()

void EffectManager::EnableClipPlane ( bool  bEnable)

enable or disable user clip planes.

the effect manager keeps two copies of the clip planes, one in world space; the other is in clip space. this function will disable clip plane immediately on the GPU; however, it will not enable clip plane immediately, instead it enable the current version of the clip planes in the BeginEffect() function.

Parameters
bEnableEnable or disable clip plane states.

§ EnableClipPlaneImmediate()

void EffectManager::EnableClipPlaneImmediate ( EffectManager::ClipPlaneState  newState,
int  nIndex = 0 
)

immediately change the device's clip plane settings if and only if it is different from the current setting.

This function is used mostly internally in BeginEffect()

§ EnableFog()

void EffectManager::EnableFog ( bool  bEnabled)

enable or disable fog.

§ EnableFullScreenGlow()

void EffectManager::EnableFullScreenGlow ( bool  bEnable)

whether full screen glow effect is used.

§ EnableGlobalLighting()

void EffectManager::EnableGlobalLighting ( bool  bEnable)

enable global sun lighting.

§ EnableLocalLighting()

void EffectManager::EnableLocalLighting ( bool  bEnable)

enable lighting.

§ EnableTextures()

void EffectManager::EnableTextures ( bool  bEnable)

one occasion to disable textures is during the shadow pass.

When textures are disabled all setTexture call will take no effect.

§ EnableZWrite()

void EffectManager::EnableZWrite ( bool  bZWriteEnabled)

this function only takes effects when IsZWriteDisabled() is false.

§ EndEffect()

void EffectManager::EndEffect ( )

end the effect,this function actually does nothing.

§ GetDefaultSamplerState()

DWORD ParaEngine::EffectManager::GetDefaultSamplerState ( int  nStage,
DWORD  dwType 
)

default sampler state.

in most cases, this will define whether the point filtering or linear filtering is used by default for all meshes and characters.

§ GetEffectByHandle()

CEffectFile * EffectManager::GetEffectByHandle ( int  nHandle)

Return the effect object by its handle.

The game engine may dynamically change the mapping from effect handle to effect objects.

Parameters
nHandlethe effect handle.
Returns
: the pointer to the effect object is returned. This may be NULL, if the handle is not bound to any object. Also the effect returned may not be supported by the hardware. Better to check before use.

§ GetEffectByName()

CEffectFile * EffectManager::GetEffectByName ( const string &  sName)

the returned effect may not be valid.

Parameters
sName: any of the following known name:
  • simple_mesh_normal_low
  • simple_mesh_normal
  • simple_mesh_normal_instanced
  • simple_mesh
  • simple_mesh_normal_ctor
  • simple_mesh_normal_unlit
  • simple_mesh_normal_selected
  • simple_mesh_normal_border
  • simple_mesh_normal_shadow
  • simple_mesh_normal_tex2
  • occlusion_test
  • ocean_fft
  • ocean_fft_high
  • waterripple
  • sky
  • fullscreen_glow
  • terrain_normal
Returns
the returned effect may not be valid or initialized. Call loadasset and check validity.

§ GetEffectHandle()

int EffectManager::GetEffectHandle ( CEffectFile effectFile)

Get the integer handle to this asset.

if there are multiple handles, the first (smallest) handle is returned. if handle is not available. it will return -1 (INVALID handle).

§ GetGlowEffect()

CGlowEffect * EffectManager::GetGlowEffect ( )

get the glow effect object.

§ GetGlowness()

const Vector4 & EffectManager::GetGlowness ( )

glowness controls the intensity of the glow in the full screen glow effect.

0 means no glow, 1 is normal glow, 3 is three times glow. default value is 1.

§ GetGlowTechnique()

int EffectManager::GetGlowTechnique ( )

Get the glow technique.

Returns
0 for 5*5 filter, 1 for 9*9 filter

§ GetMaxLocalLightsNum()

int EffectManager::GetMaxLocalLightsNum ( )

get maximum number of local lights per object.

Returns

§ GetShadowMap()

CShadowMap * EffectManager::GetShadowMap ( )

get the shadow map object.

§ GetVertexDeclaration()

VertexDeclarationPtr EffectManager::GetVertexDeclaration ( int  nIndex)

Get declaration by id.

Parameters
nIndexvalue is in
See also
VERTEX_DECLARATION
Returns
: may return NULL.

create vertex declaration if it has not been created before.

§ GetWorldTransform()

const Matrix4 & EffectManager::GetWorldTransform ( )

Get the current world transformation matrix which is used by the effect.

See also
GetTransform()

§ IsCurrentEffectValid()

bool ParaEngine::EffectManager::IsCurrentEffectValid ( )
inline

if the last call to BeginEffect() returns false, this function will be set to false.

§ IsD3DAlphaTestingDisabled()

bool EffectManager::IsD3DAlphaTestingDisabled ( )

return true, if the alpha testing have been disabled.

§ IsD3DCullingDisabled()

bool EffectManager::IsD3DCullingDisabled ( )

return true, if the alpha testing have been disabled.

§ IsGlobalLightingEnabled()

bool EffectManager::IsGlobalLightingEnabled ( )

whether global lighting is enabled.

§ IsLocalLightingEnabled()

bool EffectManager::IsLocalLightingEnabled ( )

whether lighting is enabled.

§ IsUsingFullScreenGlow()

bool EffectManager::IsUsingFullScreenGlow ( )

whether full screen glow effect is used.

§ IsZTestEnabled()

bool EffectManager::IsZTestEnabled ( )

return true, if the alpha testing have been disabled.

§ IsZWriteDisabled()

bool EffectManager::IsZWriteDisabled ( )

return true, if the alpha testing have been disabled.

§ MapHandleToEffect()

CEffectFile * EffectManager::MapHandleToEffect ( int  nHandle,
CEffectFile pNewEffect 
)

Map a nHandle to effect object.

Parameters
nHandlethe effect handle.
pNewEffectthe pointer to the effect object is returned. This may be NULL, in which case the mapping is erased.
Returns
: the old effect object, if any, is returned, otherwise NULL is returned.

§ SetAllEffectsTechnique()

void EffectManager::SetAllEffectsTechnique ( EffectTechniques  nTech)

set all effect files to a specified technique.If the effect does not have the specified technique nothing will be changed.

Parameters
nTechthe technique handle.

§ SetClipPlane()

void EffectManager::SetClipPlane ( DWORD  Index,
const float *  pPlane,
bool  bClipSpace 
)

Sets the coefficients of a user-defined clipping plane for the device.

when rendering using fixed pipeline, clip plane is in world space; when rendering with shaders, clip plane is in clip space. this

Parameters
Index:[in]Index of the clipping plane for which the plane equation coefficients are to be set.
pPlane:[in]Pointer to an address of a four-element array of values that represent the clipping plane coefficients to be set, in the form of the general plane equation.
bClipSpacetrue if the clip plane is in clip space, otherwise it is in world space. the effect will thus keep two copies of the clip planes for each coordinate system for later use.

§ SetCullingMode() [1/2]

void EffectManager::SetCullingMode ( DWORD  dwCullMode)

set the culling mode of the current effect file or the fixed function pipeline.

Parameters
dwCullModeD3DCULL_NONE, D3DCULL_CW, D3DCULL_CCW

§ SetCullingMode() [2/2]

void EffectManager::SetCullingMode ( bool  bEnable)
Parameters
bEnabletrue to enable the scene's current culling mode, false to disable it.

§ SetD3DFogState()

bool EffectManager::SetD3DFogState ( )

set d3d fog for the fixed function pipeline.

§ SetDefaultEffectMapping()

void EffectManager::SetDefaultEffectMapping ( int  nLevel)

load the default handle to effect file mapping.

Parameters
nLevelthe higher this value, the more sophisticated shader will be used. The default value is 0, which is the fixed programming pipeline without shaders. 10, VS PS shader version 1 20, VS PS shader version 2 30, VS PS shader version 3 please note that any user defined mapping will be cleared.

§ SetDefaultSamplerState()

void ParaEngine::EffectManager::SetDefaultSamplerState ( int  nStage,
DWORD  dwType,
DWORD  dwValue 
)

default sampler state.

in most cases, this will define whether the point filtering or linear filtering is used by default for all meshes and characters.

§ SetGlowness()

void EffectManager::SetGlowness ( const Vector4 Glowness)

glowness controls the intensity of the glow in the full screen glow effect.

0 means no glow, 1 is normal glow, 3 is three times glow. default value is 1.

Parameters
Glowness

§ SetGlowTechnique()

void EffectManager::SetGlowTechnique ( int  nTech)

set the glow technique

Parameters
nTech0 for 5*5 filter, 1 for 9*9 filter

§ SetMaxLocalLightsNum()

void EffectManager::SetMaxLocalLightsNum ( int  nNum)

set maximum number of local lights per object.

Parameters
nNummust be smaller than some internal value, currently its upper limit is 8

§ SetVertexDeclaration()

HRESULT EffectManager::SetVertexDeclaration ( int  nIndex)

Set declaration by id.

Parameters
nIndexvalue is in
See also
VERTEX_DECLARATION
Returns
: return S_OK if successful. .

§ UpdateD3DPipelineTransform()

void EffectManager::UpdateD3DPipelineTransform ( bool  pWorld,
bool  pView,
bool  pProjection 
)

update the transformation for both the fixed and programmable pipeline.

Parameters
pWorldworld transformation, only set if it is true,
pViewcamera view transformation, only set if it is true,
pProjectioncamera projection transformation, only set if it is true,

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