Visualization Library v1.0.3A lightweight C++ OpenGL middleware for 2D/3D graphics |
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Defines the sequence of Shader objects used to render an Actor. More...
#include <Effect.hpp>
Public Member Functions | |
Effect () | |
Constructor. | |
ref< Effect > | shallowCopy (EShaderCopyMode shader_copy) const |
Effect & | shallowCopyFrom (const Effect &other, EShaderCopyMode shader_copy) |
ref< Effect > | deepCopy () const |
Effect & | deepCopyFrom (const Effect &other) |
void | setRenderRank (int rank) |
Modifies the rendering rank of an Actor. | |
int | renderRank () const |
Returns the rendering rank of an Effect. | |
const ref< ShaderPasses > & | lod (int lod_level) const |
Returns the ShaderPasses representing the specified LOD level. | |
ref< ShaderPasses > & | lod (int lod_level) |
Returns the ShaderPasses representing the specified LOD level. | |
Shader * | shader (int lodi=0, int pass=0) |
Utility function, same as 'lod (lodi)->at(pass);'. | |
const Shader * | shader (int lodi=0, int pass=0) const |
Utility function, same as 'lod (lodi)->at(pass);'. | |
void | setLOD (int lodi, Shader *shader1, Shader *shader2=NULL, Shader *shader3=NULL, Shader *shader4=NULL) |
Utility function, same as 'lod (lodi) = new ShaderPasses(shader1,shader2,shader3,shader4);'. | |
void | setLODEvaluator (LODEvaluator *lod_evaluator) |
Installs the LODEvaluator used to compute the current LOD at rendering time. | |
LODEvaluator * | lodEvaluator () |
Returns the installed LODEvaluator (if any) or NULL. | |
const LODEvaluator * | lodEvaluator () const |
Returns the installed LODEvaluator (if any) or NULL. | |
void | setEnableMask (unsigned int mask) |
The enable mask of an Actor's Effect defines whether the actor should be rendered or not depending on the Rendering::enableMask(). | |
unsigned int | enableMask () const |
The enable mask of an Actor's Effect defines whether the actor should be rendered or not depending on the Rendering::enableMask(). | |
int | evaluateLOD (Actor *actor, Camera *camera) |
If a LODEvaluator is installed computes the effect LOD to be used otherwise returns 0. | |
void | setActiveLod (int lod) |
Sets the lod to be used for rendering. | |
int | activeLod () const |
Returns the lod to be used for rendering. | |
Protected Attributes | |
ref< ShaderPasses > | mLODShaders [VL_MAX_EFFECT_LOD] |
ref< LODEvaluator > | mLODEvaluator |
int | mActiveLod |
int | mRenderRank |
unsigned int | mEnableMask |
Defines the sequence of Shader objects used to render an Actor.
Typically an Effect will have only one LOD (level of detail) with 1 pass (i.e. 1 Shader) but you can specify multiple LODs each of which defines its own set of Shader[s].
When a LOD has more than one Shader the Actor is rendered several times, once for each Shader. This technique is called multipass rendering.
The LOD to be used during the rendering is defined at rendering time if a LODEvaluator has been installed using the method setLODEvaluator(), otherwise the LOD #0 is selected.
Definition at line 91 of file Effect.hpp.
vl::Effect::Effect | ( | ) | [inline] |
ref<Effect> vl::Effect::shallowCopy | ( | EShaderCopyMode | shader_copy ) | const [inline] |
Definition at line 110 of file Effect.hpp.
Effect& vl::Effect::shallowCopyFrom | ( | const Effect & | other, |
EShaderCopyMode | shader_copy | ||
) | [inline] |
Definition at line 117 of file Effect.hpp.
References mActiveLod, mEnableMask, mLODEvaluator, mLODShaders, mRenderRank, vl::SCM_OwnShaders, and VL_MAX_EFFECT_LOD.
Definition at line 139 of file Effect.hpp.
Definition at line 146 of file Effect.hpp.
References vl::SCM_ShareShaders, and VL_MAX_EFFECT_LOD.
void vl::Effect::setRenderRank | ( | int | rank ) | [inline] |
Modifies the rendering rank of an Actor.
The rendering rank affects the order in which an Actor is rendered, the greater the rank the later the Actor is rendered. The default render rank is zero.
To know more about rendering order please see Rendering Order.
Definition at line 164 of file Effect.hpp.
Referenced by vl::VLXClassWrapper_Effect::importEffect().
int vl::Effect::renderRank | ( | ) | const [inline] |
Returns the rendering rank of an Effect.
Definition at line 167 of file Effect.hpp.
Referenced by vl::VLXClassWrapper_Effect::exportEffect(), and vl::Rendering::fillRenderQueue().
const ref<ShaderPasses>& vl::Effect::lod | ( | int | lod_level ) | const [inline] |
Returns the ShaderPasses representing the specified LOD level.
lod_level
< VL_MAX_EFFECT_LOD. Definition at line 171 of file Effect.hpp.
Referenced by vl::VLXClassWrapper_Effect::exportEffect(), vl::Rendering::fillRenderQueue(), and vl::VLXClassWrapper_Effect::importEffect().
ref<ShaderPasses>& vl::Effect::lod | ( | int | lod_level ) | [inline] |
Returns the ShaderPasses representing the specified LOD level.
lod_level
< VL_MAX_EFFECT_LOD. Definition at line 175 of file Effect.hpp.
Shader* vl::Effect::shader | ( | int | lodi = 0 , |
int | pass = 0 |
||
) | [inline] |
Utility function, same as 'lod
(lodi)->at(pass);'.
Definition at line 178 of file Effect.hpp.
Referenced by vl::DaeLoader::load(), and vl::PlyLoader::loadPly().
const Shader* vl::Effect::shader | ( | int | lodi = 0 , |
int | pass = 0 |
||
) | const [inline] |
Utility function, same as 'lod
(lodi)->at(pass);'.
Definition at line 181 of file Effect.hpp.
void vl::Effect::setLOD | ( | int | lodi, |
Shader * | shader1, | ||
Shader * | shader2 = NULL , |
||
Shader * | shader3 = NULL , |
||
Shader * | shader4 = NULL |
||
) | [inline] |
Utility function, same as 'lod
(lodi) = new ShaderPasses(shader1,shader2,shader3,shader4);'.
Definition at line 184 of file Effect.hpp.
References VL_CHECK, and VL_MAX_EFFECT_LOD.
void vl::Effect::setLODEvaluator | ( | LODEvaluator * | lod_evaluator ) | [inline] |
Installs the LODEvaluator used to compute the current LOD at rendering time.
Definition at line 191 of file Effect.hpp.
Referenced by vl::VLXClassWrapper_Effect::importEffect().
LODEvaluator* vl::Effect::lodEvaluator | ( | ) | [inline] |
Returns the installed LODEvaluator (if any) or NULL.
Definition at line 194 of file Effect.hpp.
Referenced by vl::VLXClassWrapper_Effect::exportEffect().
const LODEvaluator* vl::Effect::lodEvaluator | ( | ) | const [inline] |
Returns the installed LODEvaluator (if any) or NULL.
Definition at line 197 of file Effect.hpp.
void vl::Effect::setEnableMask | ( | unsigned int | mask ) | [inline] |
The enable mask of an Actor's Effect defines whether the actor should be rendered or not depending on the Rendering::enableMask().
Definition at line 200 of file Effect.hpp.
Referenced by vl::VLXClassWrapper_Effect::importEffect().
unsigned int vl::Effect::enableMask | ( | ) | const [inline] |
The enable mask of an Actor's Effect defines whether the actor should be rendered or not depending on the Rendering::enableMask().
Definition at line 203 of file Effect.hpp.
Referenced by vl::VLXClassWrapper_Effect::exportEffect(), and vl::Rendering::fillRenderQueue().
If a LODEvaluator is installed computes the effect LOD to be used otherwise returns 0.
Definition at line 44 of file Effect.cpp.
References mActiveLod, mLODEvaluator, VL_CHECK, and VL_MAX_EFFECT_LOD.
Referenced by vl::Rendering::fillRenderQueue().
void vl::Effect::setActiveLod | ( | int | lod ) | [inline] |
Sets the lod to be used for rendering.
It must be: 0 <= lod < VL_MAX_EFFECT_LOD.
Definition at line 209 of file Effect.hpp.
References VL_CHECK, and VL_MAX_EFFECT_LOD.
Referenced by vl::VLXClassWrapper_Effect::importEffect().
int vl::Effect::activeLod | ( | ) | const [inline] |
Returns the lod to be used for rendering.
Definition at line 217 of file Effect.hpp.
Referenced by vl::VLXClassWrapper_Effect::exportEffect().
ref<ShaderPasses> vl::Effect::mLODShaders[VL_MAX_EFFECT_LOD] [protected] |
Definition at line 220 of file Effect.hpp.
Referenced by shallowCopyFrom().
ref<LODEvaluator> vl::Effect::mLODEvaluator [protected] |
Definition at line 221 of file Effect.hpp.
Referenced by evaluateLOD(), and shallowCopyFrom().
int vl::Effect::mActiveLod [protected] |
Definition at line 222 of file Effect.hpp.
Referenced by evaluateLOD(), and shallowCopyFrom().
int vl::Effect::mRenderRank [protected] |
Definition at line 223 of file Effect.hpp.
Referenced by shallowCopyFrom().
unsigned int vl::Effect::mEnableMask [protected] |
Definition at line 224 of file Effect.hpp.
Referenced by shallowCopyFrom().