32 #ifndef Effect_INCLUDE_ONCE 33 #define Effect_INCLUDE_ONCE 64 VL_DEBUG_SET_OBJECT_NAME()
97 Effect&
operator=(
const Effect&) {
return *
this; }
103 VL_DEBUG_SET_OBJECT_NAME()
104 mEnableMask = 0xFFFFFFFF;
113 fx->shallowCopyFrom(*
this, shader_copy);
119 for(
int i=0; i<VL_MAX_EFFECT_LOD; ++i)
125 for(
int lod=0; lod<VL_MAX_EFFECT_LOD; ++lod)
126 for(
size_t pass=0; mLODShaders[lod] && pass<mLODShaders[lod]->size(); ++pass)
127 (*mLODShaders[lod])[pass] = (*mLODShaders[lod])[pass]->shallowCopy();
142 fx->deepCopyFrom(*
this);
151 for(
int lod=0; lod<VL_MAX_EFFECT_LOD; ++lod)
152 for(
size_t pass=0; mLODShaders[lod] && pass<mLODShaders[lod]->size(); ++pass)
153 (*mLODShaders[lod])[pass] = (*mLODShaders[lod])[pass]->deepCopy();
181 const Shader*
shader(
int lodi=0,
int pass=0)
const {
return lod(lodi)->at(pass); }
187 lod(lodi) =
new ShaderPasses(shader1,shader2,shader3,shader4);
Associates a Renderable object to an Effect and Transform.
void setEnableMask(unsigned int mask)
The enable mask of an Actor's Effect defines whether the actor should be rendered or not depending on...
ref< ShaderPasses > mLODShaders[VL_MAX_EFFECT_LOD]
const Shader * shader(int lodi=0, int pass=0) const
Utility function, same as 'lod(lodi)->at(pass);'.
#define VL_INSTRUMENT_CLASS(ClassName, BaseClass)
int activeLod() const
Returns the lod to be used for rendering.
Visualization Library main namespace.
Collection & operator=(const std::vector< ref< Shader > > &vector)
Effect & deepCopyFrom(const Effect &other)
The base class for all the reference counted objects.
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 push_back(Shader *data)
const LODEvaluator * lodEvaluator() const
Returns the installed LODEvaluator (if any) or NULL.
LODEvaluator * lodEvaluator()
Returns the installed LODEvaluator (if any) or NULL.
void setRenderRank(int rank)
Modifies the rendering rank of an Actor.
A sequence of Shader objects each of which represent a rendering pass.
void setLODEvaluator(LODEvaluator *lod_evaluator)
Installs the LODEvaluator used to compute the current LOD at rendering time.
void setActiveLod(int lod)
Sets the lod to be used for rendering.
int renderRank() const
Returns the rendering rank of an Effect.
Manages most of the OpenGL rendering states responsible of the final aspect of the rendered objects...
unsigned int enableMask() const
The enable mask of an Actor's Effect defines whether the actor should be rendered or not depending on...
Abstract class to compute the appropriate LOD of an Actor or Effect.
#define VLGRAPHICS_EXPORT
Shader * shader(int lodi=0, int pass=0)
Utility function, same as 'lod(lodi)->at(pass);'.
Defines the sequence of Shader objects used to render an Actor.
Effect & shallowCopyFrom(const Effect &other, EShaderCopyMode shader_copy)
It's basically an std::vector for Objects that is itself an Object so it can be reference counted and...
A local copy of the Shaders will be created but the contained render states will be shared...
ref< LODEvaluator > mLODEvaluator
The Shader pointer will be copied as is.
The ref<> class is used to reference-count an Object.
ShaderPasses(Shader *pass1=NULL, Shader *pass2=NULL, Shader *pass3=NULL, Shader *pass4=NULL)
Constructor.
Represents a virtual camera defining, among other things, the point of view from which scenes can be ...
ref< ShaderPasses > & lod(int lod_level)
Returns the ShaderPasses representing the specified LOD level.
ref< Effect > deepCopy() const
const ref< ShaderPasses > & lod(int lod_level) const
Returns the ShaderPasses representing the specified LOD level.
ref< Effect > shallowCopy(EShaderCopyMode shader_copy) const