My Project
|
manager all effects file used by the game engine. More...
#include <EffectManager.h>
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 | |
![]() | |
typedef AssetManager< CEffectFile, CEffectFile, AssetEntity > | MyType_t |
typedef std::map< std::string, AssetEntity *> | AssetItemsNameMap_t |
typedef std::map< AssetKey, AssetEntity *> | AssetItemsSet_t |
![]() | |
typedef ParaEngine::weak_ptr< IObject, IAttributeFields > | WeakPtr_type |
![]() | |
typedef ParaEngine::weak_ptr< IObject > | WeakPtr_type |
Public Member Functions | |
CEffectFile * | GetEffectByHandle (int nHandle) |
Return the effect object by its handle. More... | |
int | GetEffectHandle (CEffectFile *effectFile) |
Get the integer handle to this asset. More... | |
CEffectFile * | GetEffectByName (const string &sName) |
the returned effect may not be valid. More... | |
CEffectFile * | MapHandleToEffect (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... | |
CShadowMap * | GetShadowMap () |
get the shadow map object. More... | |
CGlowEffect * | GetGlowEffect () |
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... | |
CEffectFile * | CheckLoadEffect (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 () |
CEffectFile * | GetCurrentEffectFile () |
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 Matrix4 & | GetWorldTransform () |
Get the current world transformation matrix which is used by the effect. More... | |
const Matrix4 & | GetViewTransform () |
const Matrix4 & | GetProjTransform () |
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 Matrix4 * | GetTexViewProjMatrix () |
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 Vector4 & | GetGlowness () |
glowness controls the intensity of the glow in the full screen glow effect. More... | |
WaveEffect * | GetScreenWaveEffect () |
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... | |
IScene * | GetScene () |
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... | |
![]() | |
ATTRIBUTE_DEFINE_CLASS (AssetManager) | |
virtual IAttributeFields * | GetChildAttributeObject (const std::string &sName) |
get attribute by child object. More... | |
virtual IAttributeFields * | GetChildAttributeObject (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... | |
CEffectFile * | GetByName (const std::string &name) |
check if there is a object with a specified name, and return the pointer to it. More... | |
AssetEntity * | get (const AssetKey &key) |
check if there is a object with a specified asset key, and return the pointer to it. More... | |
CEffectFile * | NewEntity (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... | |
CEffectFile * | GetEntity (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... | |
![]() | |
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 CDynamicAttributeField * | GetDynamicField (const std::string &sName) |
Get a dynamic field with a given name. More... | |
virtual CDynamicAttributeField * | GetDynamicField (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... | |
CAttributeClass * | GetAttributeClass () |
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... | |
![]() | |
virtual void | Clone (IObject *obj) const |
Clone the object's contains to a pointer. More... | |
virtual IObject * | Clone () 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 IType * | GetType () const |
virtual std::string | ToString () const |
WeakPtr_type & | GetWeakReference () |
get weak reference object. More... | |
virtual int | ProcessObjectEvent (const ObjectEvent &event) |
this function is only used to backward compatibility of ParaObject:AddEvent() function. More... | |
![]() | |
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 () |
CRefCounted * | AddToAutoReleasePool () |
addref and releases the ownership sometime soon automatically (usually at the end of the current frame). More... | |
Additional Inherited Members | |
![]() | |
static MyType_t & | GetInstance () |
![]() | |
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... | |
![]() | |
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. | |
![]() | |
virtual CAttributeClass * | CreateAttributeClass () |
initialize fields | |
virtual CDynamicAttributesSet * | GetDynamicAttributes (bool bCreateIfNotExist=false) |
![]() | |
WeakPtr_type | m_weak_reference |
![]() | |
int | m_refcount |
manager all effects file used by the game engine.
predefined vertex declaration.
void EffectManager::applyFogParameters | ( | ) |
automatically apply fog.
this function only works on programmable pipeline.
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.
void EffectManager::applyObjectLocalLighting | ( | CBaseObject * | pObj | ) |
automatically apply local lighting to a scene object according to the bounding volume of the object.
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.
bUseGlobalAmbient | if 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. |
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.
nHandle | the effect handle. |
pOutEffect | pointer to retrieve the effect object which is currently selected. |
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
|
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 >.
|
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.
Reimplemented from ParaEngine::AssetManager< CEffectFile >.
void EffectManager::DisableD3DAlphaTesting | ( | bool | bDisable | ) |
bDisable | if true, setting the alpha testing parameter of the effect files will not affect the d3d render state, only shader parameters are set. |
void EffectManager::DisableD3DCulling | ( | bool | bDisable | ) |
bDisable | if true, setting the culling mode of the effect files will not affect the d3d render state, only shader parameters are set. |
void EffectManager::DisableZWrite | ( | bool | bDisable | ) |
disable z write.
Any subsequent calls will be disabled.
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.
bEnable | Enable or disable clip plane states. |
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()
void EffectManager::EnableFog | ( | bool | bEnabled | ) |
enable or disable fog.
void EffectManager::EnableFullScreenGlow | ( | bool | bEnable | ) |
whether full screen glow effect is used.
void EffectManager::EnableGlobalLighting | ( | bool | bEnable | ) |
enable global sun lighting.
void EffectManager::EnableLocalLighting | ( | bool | bEnable | ) |
enable lighting.
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.
void EffectManager::EnableZWrite | ( | bool | bZWriteEnabled | ) |
this function only takes effects when IsZWriteDisabled() is false.
void EffectManager::EndEffect | ( | ) |
end the effect,this function actually does nothing.
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.
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.
nHandle | the effect handle. |
CEffectFile * EffectManager::GetEffectByName | ( | const string & | sName | ) |
the returned effect may not be valid.
sName | : any of the following known name:
|
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).
CGlowEffect * EffectManager::GetGlowEffect | ( | ) |
get the glow effect object.
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.
int EffectManager::GetGlowTechnique | ( | ) |
Get the glow technique.
int EffectManager::GetMaxLocalLightsNum | ( | ) |
get maximum number of local lights per object.
CShadowMap * EffectManager::GetShadowMap | ( | ) |
get the shadow map object.
VertexDeclarationPtr EffectManager::GetVertexDeclaration | ( | int | nIndex | ) |
Get declaration by id.
nIndex | value is in |
create vertex declaration if it has not been created before.
const Matrix4 & EffectManager::GetWorldTransform | ( | ) |
Get the current world transformation matrix which is used by the effect.
|
inline |
if the last call to BeginEffect() returns false, this function will be set to false.
bool EffectManager::IsD3DAlphaTestingDisabled | ( | ) |
return true, if the alpha testing have been disabled.
bool EffectManager::IsD3DCullingDisabled | ( | ) |
return true, if the alpha testing have been disabled.
bool EffectManager::IsGlobalLightingEnabled | ( | ) |
whether global lighting is enabled.
bool EffectManager::IsLocalLightingEnabled | ( | ) |
whether lighting is enabled.
bool EffectManager::IsUsingFullScreenGlow | ( | ) |
whether full screen glow effect is used.
bool EffectManager::IsZTestEnabled | ( | ) |
return true, if the alpha testing have been disabled.
bool EffectManager::IsZWriteDisabled | ( | ) |
return true, if the alpha testing have been disabled.
CEffectFile * EffectManager::MapHandleToEffect | ( | int | nHandle, |
CEffectFile * | pNewEffect | ||
) |
Map a nHandle to effect object.
nHandle | the effect handle. |
pNewEffect | the pointer to the effect object is returned. This may be NULL, in which case the mapping is erased. |
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.
nTech | the technique handle. |
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
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. |
bClipSpace | true 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. |
void EffectManager::SetCullingMode | ( | DWORD | dwCullMode | ) |
set the culling mode of the current effect file or the fixed function pipeline.
dwCullMode | D3DCULL_NONE, D3DCULL_CW, D3DCULL_CCW |
void EffectManager::SetCullingMode | ( | bool | bEnable | ) |
bEnable | true to enable the scene's current culling mode, false to disable it. |
bool EffectManager::SetD3DFogState | ( | ) |
set d3d fog for the fixed function pipeline.
void EffectManager::SetDefaultEffectMapping | ( | int | nLevel | ) |
load the default handle to effect file mapping.
nLevel | the 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. |
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.
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.
Glowness |
void EffectManager::SetGlowTechnique | ( | int | nTech | ) |
set the glow technique
nTech | 0 for 5*5 filter, 1 for 9*9 filter |
void EffectManager::SetMaxLocalLightsNum | ( | int | nNum | ) |
set maximum number of local lights per object.
nNum | must be smaller than some internal value, currently its upper limit is 8 |
HRESULT EffectManager::SetVertexDeclaration | ( | int | nIndex | ) |
Set declaration by id.
nIndex | value is in |
void EffectManager::UpdateD3DPipelineTransform | ( | bool | pWorld, |
bool | pView, | ||
bool | pProjection | ||
) |
update the transformation for both the fixed and programmable pipeline.
pWorld | world transformation, only set if it is true, |
pView | camera view transformation, only set if it is true, |
pProjection | camera projection transformation, only set if it is true, |