Visualization Library 2.0.0

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Attributes | List of all members
vl::Shader Class Reference

Manages most of the OpenGL rendering states responsible of the final aspect of the rendered objects. More...

#include <Shader.hpp>

+ Inheritance diagram for vl::Shader:

Public Member Functions

 Shader ()
 Constructor. More...
 
virtual ~Shader ()
 Destructor. More...
 
ref< Shader > shallowCopy () const
 Returns the shallow copy of a Shader. More...
 
Shader & shallowCopyFrom (const Shader &other)
 Performs a shallow copy from the given Shader. More...
 
ref< Shader > deepCopy () const
 Returns the deep copy of a Shader. More...
 
Shader & deepCopyFrom (const Shader &other)
 Performs a deep copy from the given Shader. More...
 
void reset ()
 Disables everything, erases all the render states, erases all the uniforms. More...
 
GLSLProgram * gocGLSLProgram ()
 Gets or creates a GLSLProgram and returns it. More...
 
const GLSLProgram * getGLSLProgram () const
 Returns a GLSLProgram if it exists or NULL otherwise. More...
 
GLSLProgram * getGLSLProgram ()
 Returns a GLSLProgram if it exists or NULL otherwise. More...
 
PixelTransfer * gocPixelTransfer ()
 
const PixelTransfer * getPixelTransfer () const
 
PixelTransfer * getPixelTransfer ()
 
Hint * gocHint ()
 
const Hint * getHint () const
 
Hint * getHint ()
 
CullFace * gocCullFace ()
 
const CullFace * getCullFace () const
 
CullFace * getCullFace ()
 
FrontFace * gocFrontFace ()
 
const FrontFace * getFrontFace () const
 
FrontFace * getFrontFace ()
 
DepthFunc * gocDepthFunc ()
 
const DepthFunc * getDepthFunc () const
 
DepthFunc * getDepthFunc ()
 
DepthMask * gocDepthMask ()
 
const DepthMask * getDepthMask () const
 
DepthMask * getDepthMask ()
 
Color * gocColor ()
 
const Color * getColor () const
 
Color * getColor ()
 
SecondaryColor * gocSecondaryColor ()
 
const SecondaryColor * getSecondaryColor () const
 
SecondaryColor * getSecondaryColor ()
 
Normal * gocNormal ()
 
const Normal * getNormal () const
 
Normal * getNormal ()
 
ColorMask * gocColorMask ()
 
const ColorMask * getColorMask () const
 
ColorMask * getColorMask ()
 
PolygonMode * gocPolygonMode ()
 
const PolygonMode * getPolygonMode () const
 
PolygonMode * getPolygonMode ()
 
ShadeModel * gocShadeModel ()
 
const ShadeModel * getShadeModel () const
 
ShadeModel * getShadeModel ()
 
BlendEquation * gocBlendEquation ()
 
const BlendEquation * getBlendEquation () const
 
BlendEquation * getBlendEquation ()
 
AlphaFunc * gocAlphaFunc ()
 
const AlphaFunc * getAlphaFunc () const
 
AlphaFunc * getAlphaFunc ()
 
Material * gocMaterial ()
 
const Material * getMaterial () const
 
Material * getMaterial ()
 
LightModel * gocLightModel ()
 
const LightModel * getLightModel () const
 
LightModel * getLightModel ()
 
Fog * gocFog ()
 
const Fog * getFog () const
 
Fog * getFog ()
 
PolygonOffset * gocPolygonOffset ()
 
const PolygonOffset * getPolygonOffset () const
 
PolygonOffset * getPolygonOffset ()
 
LogicOp * gocLogicOp ()
 
const LogicOp * getLogicOp () const
 
LogicOp * getLogicOp ()
 
DepthRange * gocDepthRange ()
 
const DepthRange * getDepthRange () const
 
DepthRange * getDepthRange ()
 
LineWidth * gocLineWidth ()
 
const LineWidth * getLineWidth () const
 
LineWidth * getLineWidth ()
 
PointSize * gocPointSize ()
 
const PointSize * getPointSize () const
 
PointSize * getPointSize ()
 
LineStipple * gocLineStipple ()
 
const LineStipple * getLineStipple () const
 
LineStipple * getLineStipple ()
 
PolygonStipple * gocPolygonStipple ()
 
const PolygonStipple * getPolygonStipple () const
 
PolygonStipple * getPolygonStipple ()
 
PointParameter * gocPointParameter ()
 
const PointParameter * getPointParameter () const
 
PointParameter * getPointParameter ()
 
StencilFunc * gocStencilFunc ()
 
const StencilFunc * getStencilFunc () const
 
StencilFunc * getStencilFunc ()
 
StencilOp * gocStencilOp ()
 
const StencilOp * getStencilOp () const
 
StencilOp * getStencilOp ()
 
StencilMask * gocStencilMask ()
 
const StencilMask * getStencilMask () const
 
StencilMask * getStencilMask ()
 
BlendColor * gocBlendColor ()
 
const BlendColor * getBlendColor () const
 
BlendColor * getBlendColor ()
 
BlendFunc * gocBlendFunc ()
 
const BlendFunc * getBlendFunc () const
 
BlendFunc * getBlendFunc ()
 
SampleCoverage * gocSampleCoverage ()
 
const SampleCoverage * getSampleCoverage () const
 
SampleCoverage * getSampleCoverage ()
 
VertexAttrib * gocVertexAttrib (int attr_index)
 
const VertexAttrib * getVertexAttrib (int attr_index) const
 
VertexAttrib * getVertexAttrib (int attr_index)
 
Light * gocLight (int light_index)
 
const Light * getLight (int light_index) const
 
Light * getLight (int light_index)
 
ClipPlane * gocClipPlane (int plane_index)
 
const ClipPlane * getClipPlane (int plane_index) const
 
ClipPlane * getClipPlane (int plane_index)
 
TextureSampler * gocTextureSampler (int unit_index)
 
const TextureSampler * getTextureSampler (int unit_index) const
 
TextureSampler * getTextureSampler (int unit_index)
 
TexEnv * gocTexEnv (int unit_index)
 
const TexEnv * getTexEnv (int unit_index) const
 
TexEnv * getTexEnv (int unit_index)
 
TexGen * gocTexGen (int unit_index)
 
const TexGen * getTexGen (int unit_index) const
 
TexGen * getTexGen (int unit_index)
 
TextureMatrix * gocTextureMatrix (int unit_index)
 
const TextureMatrix * getTextureMatrix (int unit_index) const
 
TextureMatrix * getTextureMatrix (int unit_index)
 
void enable (EEnable capability)
 
void disable (EEnable capability)
 
const std::vector< EEnable > & enables () const
 
int isEnabled (EEnable capability) const
 
void disableAll ()
 
bool isBlendingEnabled () const
 
void setRenderState (RenderStateNonIndexed *renderstate)
 
void setRenderState (RenderState *renderstate, int index)
 
const RenderState * renderState (ERenderState type, int index=0) const
 
RenderState * renderState (ERenderState type, int index=0)
 
size_t renderStatesCount () const
 
const RenderStateSlot * renderStates () const
 
RenderStateSlot * renderStates ()
 
void eraseRenderState (ERenderState type, int index=-1)
 If index == -1 all the renderstates of the given type are removed regardless of their binding index. More...
 
void eraseRenderState (RenderState *rs, int index)
 
void eraseAllRenderStates ()
 
const GLSLProgram * glslProgram () const
 Returns the GLSLProgram associated to a Shader (if any) More...
 
GLSLProgram * glslProgram ()
 Returns the GLSLProgram associated to a Shader (if any) More...
 
void setUniform (Uniform *uniform)
 Equivalent to gocUniformSet()->setUniform(...) More...
 
const std::vector< ref< Uniform > > & uniforms () const
 Equivalent to gocUniformSet()->uniforms(...) More...
 
void eraseUniform (const char *name)
 Equivalent to gocUniformSet()->eraseUniform(...) More...
 
void eraseUniform (const Uniform *uniform)
 Equivalent to gocUniformSet()->eraseUniform(...) More...
 
void eraseAllUniforms ()
 Equivalent to gocUniformSet()->eraseAllUniforms(...) More...
 
Uniform * gocUniform (const char *name)
 Equivalent to gocUniformSet()->gocUniform(...) More...
 
Uniform * getUniform (const char *name)
 Equivalent to gocUniformSet()->getUniform(...) More...
 
const Uniform * getUniform (const char *name) const
 Equivalent to gocUniformSet()->getUniform(...) More...
 
EnableSet * gocEnableSet ()
 
EnableSet * getEnableSet ()
 
const EnableSet * getEnableSet () const
 
RenderStateSet * gocRenderStateSet ()
 
RenderStateSet * getRenderStateSet ()
 
const RenderStateSet * getRenderStateSet () const
 
UniformSet * gocUniformSet ()
 Returns the UniformSet installed (creating it if no UniformSet has been installed) More...
 
UniformSet * getUniformSet ()
 Returns the UniformSet installed. More...
 
const UniformSet * getUniformSet () const
 Returns the UniformSet installed. More...
 
void setEnableSet (EnableSet *es)
 
void setRenderStateSet (RenderStateSet *rss)
 
void setUniformSet (UniformSet *us)
 Installs a new UniformSet. More...
 
void setScissor (Scissor *scissor)
 Sets the Scissor to be used when rendering an Actor. More...
 
const Scissor * scissor () const
 Returns the Scissor to be used when rendering an Actor. More...
 
Scissor * scissor ()
 Returns the Scissor to be used when rendering an Actor. More...
 
void setShaderAnimator (ShaderAnimator *animator)
 Installs the ShaderAnimator used to update/animate a Shader (see vl::ShaderAnimator documentation). More...
 
ShaderAnimator * shaderAnimator ()
 Returns the ShaderAnimator used to update/animate a Shader (see vl::ShaderAnimator documentation). More...
 
const ShaderAnimator * shaderAnimator () const
 Returns the ShaderAnimator used to update/animate a Shader (see vl::ShaderAnimator documentation). More...
 
real lastUpdateTime () const
 Last time this Actor was animated/updated using a shaderAnimator(). More...
 
void setLastUpdateTime (real time)
 Used internally. More...
 
- Public Member Functions inherited from vl::Object
 Object ()
 Constructor. More...
 
 Object (const Object &other)
 Copy constructor: copies the name, ref count mutex and user data. More...
 
Object & operator= (const Object &other)
 Copy operator: copies the object's name, ref count mutex and user data. More...
 
const std::string & objectName () const
 The name of the object, by default set to the object's class name. More...
 
void setObjectName (const char *name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setObjectName (const std::string &name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setRefCountMutex (IMutex *mutex)
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
IMutex * refCountMutex ()
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
const IMutex * refCountMutex () const
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
int referenceCount () const
 Returns the number of references of an object. More...
 
void incReference () const
 Increments the reference count of an object. More...
 
void decReference ()
 Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More...
 
void setAutomaticDelete (bool autodel_on)
 If set to true the Object is deleted when its reference count reaches 0. More...
 
bool automaticDelete () const
 If set to true the Object is deleted when its reference count reaches 0. More...
 
template<class T >
T * as ()
 Casts an Object to the specified class. More...
 
template<class T >
const T * as () const
 Casts an Object to the specified class. More...
 

Protected Attributes

ref< RenderStateSet > mRenderStateSet
 
ref< EnableSet > mEnableSet
 
ref< UniformSet > mUniformSet
 
ref< Scissor > mScissor
 
ref< ShaderAnimator > mShaderAnimator
 
real mLastUpdateTime
 
- Protected Attributes inherited from vl::Object
std::string mObjectName
 
IMutex * mRefCountMutex
 
int mReferenceCount
 
bool mAutomaticDelete
 

Additional Inherited Members

- Protected Member Functions inherited from vl::Object
virtual ~Object ()
 

Detailed Description

Manages most of the OpenGL rendering states responsible of the final aspect of the rendered objects.

A Shader represents a rendering pass. Using the Effect class you can assign more rendering passes to an Actor. You can also specify different sets of rendering passes for each Effect LOD, for more information see Effect.

Remarks
The Uniforms defined in the Actor and the ones defined in the Shader must not overlap, that is, an Actor must not define Uniforms present in the Shader and vice versa.
See also
Effect, Actor

Definition at line 1830 of file Shader.hpp.

Constructor & Destructor Documentation

◆ Shader()

Shader::Shader ( )

Constructor.

Definition at line 45 of file Shader.cpp.

References mLastUpdateTime, and NULL.

◆ ~Shader()

Shader::~Shader ( )
virtual

Destructor.

Definition at line 55 of file Shader.cpp.

Member Function Documentation

◆ deepCopy()

ref<Shader> vl::Shader::deepCopy ( ) const
inline

Returns the deep copy of a Shader.

Definition at line 1901 of file Shader.hpp.

References deepCopyFrom().

◆ deepCopyFrom()

Shader& vl::Shader::deepCopyFrom ( const Shader &  other)
inline

Performs a deep copy from the given Shader.

Definition at line 1909 of file Shader.hpp.

References vl::RenderStateSet::deepCopyFrom(), vl::UniformSet::deepCopyFrom(), mEnableSet, mRenderStateSet, mScissor, mShaderAnimator, mUniformSet, and NULL.

Referenced by deepCopy().

◆ disable()

void vl::Shader::disable ( EEnable  capability)
inline

Definition at line 2160 of file Shader.hpp.

Referenced by vl::ObjLoader::loadOBJ().

◆ disableAll()

void vl::Shader::disableAll ( )
inline

Definition at line 2166 of file Shader.hpp.

Referenced by vl::ShaderNode::inherit().

◆ enable()

void vl::Shader::enable ( EEnable  capability)
inline

◆ enables()

const std::vector<EEnable>& vl::Shader::enables ( ) const
inline

Definition at line 2162 of file Shader.hpp.

◆ eraseAllRenderStates()

void vl::Shader::eraseAllRenderStates ( )
inline

Definition at line 2191 of file Shader.hpp.

Referenced by vl::ShaderNode::inherit().

◆ eraseAllUniforms()

void vl::Shader::eraseAllUniforms ( )
inline

Equivalent to gocUniformSet()->eraseAllUniforms(...)

Definition at line 2214 of file Shader.hpp.

Referenced by vl::ShaderNode::inherit().

◆ eraseRenderState() [1/2]

void vl::Shader::eraseRenderState ( ERenderState  type,
int  index = -1 
)
inline

If index == -1 all the renderstates of the given type are removed regardless of their binding index.

Definition at line 2187 of file Shader.hpp.

◆ eraseRenderState() [2/2]

void vl::Shader::eraseRenderState ( RenderState *  rs,
int  index 
)
inline

Definition at line 2189 of file Shader.hpp.

References vl::RenderState::type().

◆ eraseUniform() [1/2]

void vl::Shader::eraseUniform ( const char *  name)
inline

Equivalent to gocUniformSet()->eraseUniform(...)

Definition at line 2208 of file Shader.hpp.

◆ eraseUniform() [2/2]

void vl::Shader::eraseUniform ( const Uniform *  uniform)
inline

Equivalent to gocUniformSet()->eraseUniform(...)

Definition at line 2211 of file Shader.hpp.

◆ getAlphaFunc() [1/2]

const AlphaFunc* vl::Shader::getAlphaFunc ( ) const
inline

Definition at line 2027 of file Shader.hpp.

References NULL, and vl::RS_AlphaFunc.

◆ getAlphaFunc() [2/2]

AlphaFunc* vl::Shader::getAlphaFunc ( )
inline

Definition at line 2028 of file Shader.hpp.

References NULL, and vl::RS_AlphaFunc.

◆ getBlendColor() [1/2]

const BlendColor* vl::Shader::getBlendColor ( ) const
inline

Definition at line 2087 of file Shader.hpp.

References NULL, and vl::RS_BlendColor.

◆ getBlendColor() [2/2]

BlendColor* vl::Shader::getBlendColor ( )
inline

Definition at line 2088 of file Shader.hpp.

References NULL, and vl::RS_BlendColor.

◆ getBlendEquation() [1/2]

const BlendEquation* vl::Shader::getBlendEquation ( ) const
inline

Definition at line 2023 of file Shader.hpp.

References NULL, and vl::RS_BlendEquation.

◆ getBlendEquation() [2/2]

BlendEquation* vl::Shader::getBlendEquation ( )
inline

Definition at line 2024 of file Shader.hpp.

References NULL, and vl::RS_BlendEquation.

◆ getBlendFunc() [1/2]

const BlendFunc* vl::Shader::getBlendFunc ( ) const
inline

Definition at line 2091 of file Shader.hpp.

References NULL, and vl::RS_BlendFunc.

◆ getBlendFunc() [2/2]

BlendFunc* vl::Shader::getBlendFunc ( )
inline

Definition at line 2092 of file Shader.hpp.

References NULL, and vl::RS_BlendFunc.

◆ getClipPlane() [1/2]

const ClipPlane * Shader::getClipPlane ( int  plane_index) const

◆ getClipPlane() [2/2]

ClipPlane * Shader::getClipPlane ( int  plane_index)

◆ getColor() [1/2]

const Color* vl::Shader::getColor ( ) const
inline

Definition at line 1999 of file Shader.hpp.

References NULL, and vl::RS_Color.

◆ getColor() [2/2]

Color* vl::Shader::getColor ( )
inline

Definition at line 2000 of file Shader.hpp.

References NULL, and vl::RS_Color.

◆ getColorMask() [1/2]

const ColorMask* vl::Shader::getColorMask ( ) const
inline

Definition at line 2011 of file Shader.hpp.

References NULL, and vl::RS_ColorMask.

◆ getColorMask() [2/2]

ColorMask* vl::Shader::getColorMask ( )
inline

Definition at line 2012 of file Shader.hpp.

References NULL, and vl::RS_ColorMask.

◆ getCullFace() [1/2]

const CullFace* vl::Shader::getCullFace ( ) const
inline

Definition at line 1983 of file Shader.hpp.

References NULL, and vl::RS_CullFace.

◆ getCullFace() [2/2]

CullFace* vl::Shader::getCullFace ( )
inline

Definition at line 1984 of file Shader.hpp.

References NULL, and vl::RS_CullFace.

◆ getDepthFunc() [1/2]

const DepthFunc* vl::Shader::getDepthFunc ( ) const
inline

Definition at line 1991 of file Shader.hpp.

References NULL, and vl::RS_DepthFunc.

◆ getDepthFunc() [2/2]

DepthFunc* vl::Shader::getDepthFunc ( )
inline

Definition at line 1992 of file Shader.hpp.

References NULL, and vl::RS_DepthFunc.

◆ getDepthMask() [1/2]

const DepthMask* vl::Shader::getDepthMask ( ) const
inline

Definition at line 1995 of file Shader.hpp.

References NULL, and vl::RS_DepthMask.

◆ getDepthMask() [2/2]

DepthMask* vl::Shader::getDepthMask ( )
inline

Definition at line 1996 of file Shader.hpp.

References NULL, and vl::RS_DepthMask.

◆ getDepthRange() [1/2]

const DepthRange* vl::Shader::getDepthRange ( ) const
inline

Definition at line 2051 of file Shader.hpp.

References NULL, and vl::RS_DepthRange.

◆ getDepthRange() [2/2]

DepthRange* vl::Shader::getDepthRange ( )
inline

Definition at line 2052 of file Shader.hpp.

References NULL, and vl::RS_DepthRange.

◆ getEnableSet() [1/2]

EnableSet* vl::Shader::getEnableSet ( )
inline

◆ getEnableSet() [2/2]

const EnableSet* vl::Shader::getEnableSet ( ) const
inline

Definition at line 2231 of file Shader.hpp.

◆ getFog() [1/2]

const Fog* vl::Shader::getFog ( ) const
inline

Definition at line 2039 of file Shader.hpp.

References NULL, and vl::RS_Fog.

◆ getFog() [2/2]

Fog* vl::Shader::getFog ( )
inline

Definition at line 2040 of file Shader.hpp.

References NULL, and vl::RS_Fog.

◆ getFrontFace() [1/2]

const FrontFace* vl::Shader::getFrontFace ( ) const
inline

Definition at line 1987 of file Shader.hpp.

References NULL, and vl::RS_FrontFace.

◆ getFrontFace() [2/2]

FrontFace* vl::Shader::getFrontFace ( )
inline

Definition at line 1988 of file Shader.hpp.

References NULL, and vl::RS_FrontFace.

◆ getGLSLProgram() [1/2]

const GLSLProgram * Shader::getGLSLProgram ( ) const

◆ getGLSLProgram() [2/2]

GLSLProgram * Shader::getGLSLProgram ( )

Returns a GLSLProgram if it exists or NULL otherwise.

Definition at line 64 of file Shader.cpp.

References getRenderStateSet(), vl::RenderStateSet::renderState(), and vl::RS_GLSLProgram.

◆ getHint() [1/2]

const Hint* vl::Shader::getHint ( ) const
inline

Definition at line 1979 of file Shader.hpp.

References NULL, and vl::RS_Hint.

◆ getHint() [2/2]

Hint* vl::Shader::getHint ( )
inline

Definition at line 1980 of file Shader.hpp.

References NULL, and vl::RS_Hint.

◆ getLight() [1/2]

const Light * Shader::getLight ( int  light_index) const

◆ getLight() [2/2]

Light * Shader::getLight ( int  light_index)

Definition at line 163 of file Shader.cpp.

References getRenderStateSet(), NULL, vl::RenderStateSet::renderState(), and vl::RS_Light.

◆ getLightModel() [1/2]

const LightModel* vl::Shader::getLightModel ( ) const
inline

Definition at line 2035 of file Shader.hpp.

References NULL, and vl::RS_LightModel.

◆ getLightModel() [2/2]

LightModel* vl::Shader::getLightModel ( )
inline

Definition at line 2036 of file Shader.hpp.

References NULL, and vl::RS_LightModel.

◆ getLineStipple() [1/2]

const LineStipple* vl::Shader::getLineStipple ( ) const
inline

Definition at line 2063 of file Shader.hpp.

References NULL, and vl::RS_LineStipple.

◆ getLineStipple() [2/2]

LineStipple* vl::Shader::getLineStipple ( )
inline

Definition at line 2064 of file Shader.hpp.

References NULL, and vl::RS_LineStipple.

◆ getLineWidth() [1/2]

const LineWidth* vl::Shader::getLineWidth ( ) const
inline

Definition at line 2055 of file Shader.hpp.

References NULL, and vl::RS_LineWidth.

◆ getLineWidth() [2/2]

LineWidth* vl::Shader::getLineWidth ( )
inline

Definition at line 2056 of file Shader.hpp.

References NULL, and vl::RS_LineWidth.

◆ getLogicOp() [1/2]

const LogicOp* vl::Shader::getLogicOp ( ) const
inline

Definition at line 2047 of file Shader.hpp.

References NULL, and vl::RS_LogicOp.

◆ getLogicOp() [2/2]

LogicOp* vl::Shader::getLogicOp ( )
inline

Definition at line 2048 of file Shader.hpp.

References NULL, and vl::RS_LogicOp.

◆ getMaterial() [1/2]

const Material* vl::Shader::getMaterial ( ) const
inline

Definition at line 2031 of file Shader.hpp.

References NULL, and vl::RS_Material.

◆ getMaterial() [2/2]

Material* vl::Shader::getMaterial ( )
inline

Definition at line 2032 of file Shader.hpp.

References NULL, and vl::RS_Material.

◆ getNormal() [1/2]

const Normal* vl::Shader::getNormal ( ) const
inline

Definition at line 2007 of file Shader.hpp.

References NULL, and vl::RS_Normal.

◆ getNormal() [2/2]

Normal* vl::Shader::getNormal ( )
inline

Definition at line 2008 of file Shader.hpp.

References NULL, and vl::RS_Normal.

◆ getPixelTransfer() [1/2]

const PixelTransfer* vl::Shader::getPixelTransfer ( ) const
inline

Definition at line 1975 of file Shader.hpp.

References NULL, and vl::RS_PixelTransfer.

◆ getPixelTransfer() [2/2]

PixelTransfer* vl::Shader::getPixelTransfer ( )
inline

Definition at line 1976 of file Shader.hpp.

References NULL, and vl::RS_PixelTransfer.

◆ getPointParameter() [1/2]

const PointParameter* vl::Shader::getPointParameter ( ) const
inline

Definition at line 2071 of file Shader.hpp.

References NULL, and vl::RS_PointParameter.

◆ getPointParameter() [2/2]

PointParameter* vl::Shader::getPointParameter ( )
inline

Definition at line 2072 of file Shader.hpp.

References NULL, and vl::RS_PointParameter.

◆ getPointSize() [1/2]

const PointSize* vl::Shader::getPointSize ( ) const
inline

Definition at line 2059 of file Shader.hpp.

References NULL, and vl::RS_PointSize.

◆ getPointSize() [2/2]

PointSize* vl::Shader::getPointSize ( )
inline

Definition at line 2060 of file Shader.hpp.

References NULL, and vl::RS_PointSize.

◆ getPolygonMode() [1/2]

const PolygonMode* vl::Shader::getPolygonMode ( ) const
inline

Definition at line 2015 of file Shader.hpp.

References NULL, and vl::RS_PolygonMode.

◆ getPolygonMode() [2/2]

PolygonMode* vl::Shader::getPolygonMode ( )
inline

Definition at line 2016 of file Shader.hpp.

References NULL, and vl::RS_PolygonMode.

◆ getPolygonOffset() [1/2]

const PolygonOffset* vl::Shader::getPolygonOffset ( ) const
inline

Definition at line 2043 of file Shader.hpp.

References NULL, and vl::RS_PolygonOffset.

◆ getPolygonOffset() [2/2]

PolygonOffset* vl::Shader::getPolygonOffset ( )
inline

Definition at line 2044 of file Shader.hpp.

References NULL, and vl::RS_PolygonOffset.

◆ getPolygonStipple() [1/2]

const PolygonStipple* vl::Shader::getPolygonStipple ( ) const
inline

Definition at line 2067 of file Shader.hpp.

References NULL, and vl::RS_PolygonStipple.

◆ getPolygonStipple() [2/2]

PolygonStipple* vl::Shader::getPolygonStipple ( )
inline

Definition at line 2068 of file Shader.hpp.

References NULL, and vl::RS_PolygonStipple.

◆ getRenderStateSet() [1/2]

RenderStateSet* vl::Shader::getRenderStateSet ( )
inline

◆ getRenderStateSet() [2/2]

const RenderStateSet* vl::Shader::getRenderStateSet ( ) const
inline

Definition at line 2237 of file Shader.hpp.

◆ getSampleCoverage() [1/2]

const SampleCoverage* vl::Shader::getSampleCoverage ( ) const
inline

Definition at line 2095 of file Shader.hpp.

References NULL, and vl::RS_SampleCoverage.

◆ getSampleCoverage() [2/2]

SampleCoverage* vl::Shader::getSampleCoverage ( )
inline

Definition at line 2096 of file Shader.hpp.

References NULL, and vl::RS_SampleCoverage.

◆ getSecondaryColor() [1/2]

const SecondaryColor* vl::Shader::getSecondaryColor ( ) const
inline

Definition at line 2003 of file Shader.hpp.

References NULL, and vl::RS_SecondaryColor.

◆ getSecondaryColor() [2/2]

SecondaryColor* vl::Shader::getSecondaryColor ( )
inline

Definition at line 2004 of file Shader.hpp.

References NULL, and vl::RS_SecondaryColor.

◆ getShadeModel() [1/2]

const ShadeModel* vl::Shader::getShadeModel ( ) const
inline

Definition at line 2019 of file Shader.hpp.

References NULL, and vl::RS_ShadeModel.

◆ getShadeModel() [2/2]

ShadeModel* vl::Shader::getShadeModel ( )
inline

Definition at line 2020 of file Shader.hpp.

References NULL, and vl::RS_ShadeModel.

◆ getStencilFunc() [1/2]

const StencilFunc* vl::Shader::getStencilFunc ( ) const
inline

Definition at line 2075 of file Shader.hpp.

References NULL, and vl::RS_StencilFunc.

◆ getStencilFunc() [2/2]

StencilFunc* vl::Shader::getStencilFunc ( )
inline

Definition at line 2076 of file Shader.hpp.

References NULL, and vl::RS_StencilFunc.

◆ getStencilMask() [1/2]

const StencilMask* vl::Shader::getStencilMask ( ) const
inline

Definition at line 2083 of file Shader.hpp.

References NULL, and vl::RS_StencilMask.

◆ getStencilMask() [2/2]

StencilMask* vl::Shader::getStencilMask ( )
inline

Definition at line 2084 of file Shader.hpp.

References NULL, and vl::RS_StencilMask.

◆ getStencilOp() [1/2]

const StencilOp* vl::Shader::getStencilOp ( ) const
inline

Definition at line 2079 of file Shader.hpp.

References NULL, and vl::RS_StencilOp.

◆ getStencilOp() [2/2]

StencilOp* vl::Shader::getStencilOp ( )
inline

Definition at line 2080 of file Shader.hpp.

References NULL, and vl::RS_StencilOp.

◆ getTexEnv() [1/2]

const TexEnv* vl::Shader::getTexEnv ( int  unit_index) const
inline

Definition at line 2136 of file Shader.hpp.

References vl::RS_TexEnv.

◆ getTexEnv() [2/2]

TexEnv* vl::Shader::getTexEnv ( int  unit_index)
inline

Definition at line 2138 of file Shader.hpp.

References vl::RS_TexEnv.

◆ getTexGen() [1/2]

const TexGen* vl::Shader::getTexGen ( int  unit_index) const
inline

Definition at line 2144 of file Shader.hpp.

References vl::RS_TexGen.

◆ getTexGen() [2/2]

TexGen* vl::Shader::getTexGen ( int  unit_index)
inline

Definition at line 2146 of file Shader.hpp.

References vl::RS_TexGen.

◆ getTextureMatrix() [1/2]

const TextureMatrix* vl::Shader::getTextureMatrix ( int  unit_index) const
inline

Definition at line 2152 of file Shader.hpp.

References vl::RS_TextureMatrix.

◆ getTextureMatrix() [2/2]

TextureMatrix* vl::Shader::getTextureMatrix ( int  unit_index)
inline

Definition at line 2154 of file Shader.hpp.

References vl::RS_TextureMatrix.

◆ getTextureSampler() [1/2]

const TextureSampler* vl::Shader::getTextureSampler ( int  unit_index) const
inline

Definition at line 2128 of file Shader.hpp.

References vl::RS_TextureSampler.

Referenced by vl::RaycastVolume::updateUniforms().

◆ getTextureSampler() [2/2]

TextureSampler* vl::Shader::getTextureSampler ( int  unit_index)
inline

Definition at line 2130 of file Shader.hpp.

References vl::RS_TextureSampler.

◆ getUniform() [1/2]

Uniform* vl::Shader::getUniform ( const char *  name)
inline

Equivalent to gocUniformSet()->getUniform(...)

Definition at line 2220 of file Shader.hpp.

References vl::Uniform::getUniform().

◆ getUniform() [2/2]

const Uniform* vl::Shader::getUniform ( const char *  name) const
inline

Equivalent to gocUniformSet()->getUniform(...)

Definition at line 2223 of file Shader.hpp.

References vl::Uniform::getUniform().

◆ getUniformSet() [1/2]

UniformSet* vl::Shader::getUniformSet ( )
inline

◆ getUniformSet() [2/2]

const UniformSet* vl::Shader::getUniformSet ( ) const
inline

◆ getVertexAttrib() [1/2]

const VertexAttrib * Shader::getVertexAttrib ( int  attr_index) const

◆ getVertexAttrib() [2/2]

VertexAttrib * Shader::getVertexAttrib ( int  attr_index)

◆ glslProgram() [1/2]

const GLSLProgram* vl::Shader::glslProgram ( ) const
inline

◆ glslProgram() [2/2]

GLSLProgram* vl::Shader::glslProgram ( )
inline

Returns the GLSLProgram associated to a Shader (if any)

Definition at line 2197 of file Shader.hpp.

◆ gocAlphaFunc()

AlphaFunc * Shader::gocAlphaFunc ( )

Definition at line 117 of file Shader.cpp.

References GET_OR_CREATE.

Referenced by vl::ObjLoader::loadOBJ(), and vl::VectorGraphics::popScissor().

◆ gocBlendColor()

BlendColor * Shader::gocBlendColor ( )

Definition at line 147 of file Shader.cpp.

References GET_OR_CREATE.

◆ gocBlendEquation()

BlendEquation * Shader::gocBlendEquation ( )

Definition at line 115 of file Shader.cpp.

References GET_OR_CREATE.

Referenced by vl::VectorGraphics::popScissor().

◆ gocBlendFunc()

BlendFunc * Shader::gocBlendFunc ( )

Definition at line 149 of file Shader.cpp.

References GET_OR_CREATE.

Referenced by vl::loadAC3D(), and vl::VectorGraphics::popScissor().

◆ gocClipPlane()

ClipPlane * Shader::gocClipPlane ( int  plane_index)

Definition at line 165 of file Shader.cpp.

References GET_OR_CREATE_IDX.

◆ gocColor()

Color * Shader::gocColor ( )

◆ gocColorMask()

ColorMask * Shader::gocColorMask ( )

◆ gocCullFace()

CullFace * Shader::gocCullFace ( )

Definition at line 95 of file Shader.cpp.

References GET_OR_CREATE.

◆ gocDepthFunc()

DepthFunc * Shader::gocDepthFunc ( )

Definition at line 99 of file Shader.cpp.

References GET_OR_CREATE.

Referenced by vl::OcclusionCullRenderer::OcclusionCullRenderer().

◆ gocDepthMask()

DepthMask * Shader::gocDepthMask ( )

Definition at line 101 of file Shader.cpp.

References GET_OR_CREATE.

Referenced by vl::OcclusionCullRenderer::OcclusionCullRenderer().

◆ gocDepthRange()

DepthRange * Shader::gocDepthRange ( )

Definition at line 129 of file Shader.cpp.

References GET_OR_CREATE.

◆ gocEnableSet()

EnableSet* vl::Shader::gocEnableSet ( )
inline

Definition at line 2227 of file Shader.hpp.

◆ gocFog()

Fog * Shader::gocFog ( )

Definition at line 123 of file Shader.cpp.

References GET_OR_CREATE.

◆ gocFrontFace()

FrontFace * Shader::gocFrontFace ( )

Definition at line 97 of file Shader.cpp.

References GET_OR_CREATE.

◆ gocGLSLProgram()

GLSLProgram * Shader::gocGLSLProgram ( )

Gets or creates a GLSLProgram and returns it.

Definition at line 89 of file Shader.cpp.

References GET_OR_CREATE.

◆ gocHint()

Hint * Shader::gocHint ( )

Definition at line 93 of file Shader.cpp.

References GET_OR_CREATE.

Referenced by vl::VectorGraphics::popScissor().

◆ gocLight()

Light * Shader::gocLight ( int  light_index)

Definition at line 159 of file Shader.cpp.

References GET_OR_CREATE_IDX.

◆ gocLightModel()

LightModel * Shader::gocLightModel ( )

◆ gocLineStipple()

LineStipple * Shader::gocLineStipple ( )

Definition at line 135 of file Shader.cpp.

References GET_OR_CREATE.

Referenced by vl::VectorGraphics::popScissor().

◆ gocLineWidth()

LineWidth * Shader::gocLineWidth ( )

◆ gocLogicOp()

LogicOp * Shader::gocLogicOp ( )

Definition at line 127 of file Shader.cpp.

References GET_OR_CREATE.

Referenced by vl::VectorGraphics::popScissor().

◆ gocMaterial()

Material * Shader::gocMaterial ( )

◆ gocNormal()

Normal * Shader::gocNormal ( )

Definition at line 107 of file Shader.cpp.

References GET_OR_CREATE.

◆ gocPixelTransfer()

PixelTransfer * Shader::gocPixelTransfer ( )

Definition at line 91 of file Shader.cpp.

References GET_OR_CREATE.

◆ gocPointParameter()

PointParameter * Shader::gocPointParameter ( )

Definition at line 139 of file Shader.cpp.

References GET_OR_CREATE.

◆ gocPointSize()

PointSize * Shader::gocPointSize ( )

Definition at line 133 of file Shader.cpp.

References GET_OR_CREATE.

Referenced by vl::VectorGraphics::popScissor().

◆ gocPolygonMode()

PolygonMode * Shader::gocPolygonMode ( )

Definition at line 111 of file Shader.cpp.

References GET_OR_CREATE.

Referenced by vl::DaeLoader::setupLights().

◆ gocPolygonOffset()

PolygonOffset * Shader::gocPolygonOffset ( )

Definition at line 125 of file Shader.cpp.

References GET_OR_CREATE.

Referenced by vl::OcclusionCullRenderer::OcclusionCullRenderer().

◆ gocPolygonStipple()

PolygonStipple * Shader::gocPolygonStipple ( )

Definition at line 137 of file Shader.cpp.

References GET_OR_CREATE.

Referenced by vl::VectorGraphics::popScissor().

◆ gocRenderStateSet()

RenderStateSet* vl::Shader::gocRenderStateSet ( )
inline

Definition at line 2233 of file Shader.hpp.

Referenced by vl::Rendering::fillRenderQueue().

◆ gocSampleCoverage()

SampleCoverage * Shader::gocSampleCoverage ( )

Definition at line 151 of file Shader.cpp.

References GET_OR_CREATE.

◆ gocSecondaryColor()

SecondaryColor * Shader::gocSecondaryColor ( )

Definition at line 105 of file Shader.cpp.

References GET_OR_CREATE.

◆ gocShadeModel()

ShadeModel * Shader::gocShadeModel ( )

Definition at line 113 of file Shader.cpp.

References GET_OR_CREATE.

◆ gocStencilFunc()

StencilFunc * Shader::gocStencilFunc ( )

Definition at line 141 of file Shader.cpp.

References GET_OR_CREATE.

Referenced by vl::VectorGraphics::popScissor().

◆ gocStencilMask()

StencilMask * Shader::gocStencilMask ( )

Definition at line 145 of file Shader.cpp.

References GET_OR_CREATE.

Referenced by vl::VectorGraphics::popScissor().

◆ gocStencilOp()

StencilOp * Shader::gocStencilOp ( )

Definition at line 143 of file Shader.cpp.

References GET_OR_CREATE.

Referenced by vl::VectorGraphics::popScissor().

◆ gocTexEnv()

TexEnv * Shader::gocTexEnv ( int  unit_index)

Definition at line 175 of file Shader.cpp.

References GET_OR_CREATE_IDX.

Referenced by vl::VectorGraphics::popScissor().

◆ gocTexGen()

TexGen * Shader::gocTexGen ( int  unit_index)

Definition at line 173 of file Shader.cpp.

References GET_OR_CREATE_IDX.

◆ gocTextureMatrix()

TextureMatrix * Shader::gocTextureMatrix ( int  unit_index)

Definition at line 177 of file Shader.cpp.

References GET_OR_CREATE_IDX.

◆ gocTextureSampler()

TextureSampler * Shader::gocTextureSampler ( int  unit_index)

◆ gocUniform()

Uniform* vl::Shader::gocUniform ( const char *  name)
inline

Equivalent to gocUniformSet()->gocUniform(...)

Definition at line 2217 of file Shader.hpp.

◆ gocUniformSet()

UniformSet* vl::Shader::gocUniformSet ( )
inline

Returns the UniformSet installed (creating it if no UniformSet has been installed)

See also

Definition at line 2249 of file Shader.hpp.

◆ gocVertexAttrib()

VertexAttrib * Shader::gocVertexAttrib ( int  attr_index)

Definition at line 153 of file Shader.cpp.

References GET_OR_CREATE_IDX.

◆ isBlendingEnabled()

bool vl::Shader::isBlendingEnabled ( ) const
inline

◆ isEnabled()

int vl::Shader::isEnabled ( EEnable  capability) const
inline

Definition at line 2164 of file Shader.hpp.

Referenced by vl::DaeLoader::load().

◆ lastUpdateTime()

real vl::Shader::lastUpdateTime ( ) const
inline

Last time this Actor was animated/updated using a shaderAnimator().

Definition at line 2330 of file Shader.hpp.

Referenced by vl::Rendering::fillRenderQueue().

◆ renderState() [1/2]

const RenderState* vl::Shader::renderState ( ERenderState  type,
int  index = 0 
) const
inline

Definition at line 2176 of file Shader.hpp.

References NULL.

◆ renderState() [2/2]

RenderState* vl::Shader::renderState ( ERenderState  type,
int  index = 0 
)
inline

Definition at line 2178 of file Shader.hpp.

◆ renderStates() [1/2]

const RenderStateSlot* vl::Shader::renderStates ( ) const
inline

Definition at line 2182 of file Shader.hpp.

◆ renderStates() [2/2]

RenderStateSlot* vl::Shader::renderStates ( )
inline

Definition at line 2184 of file Shader.hpp.

◆ renderStatesCount()

size_t vl::Shader::renderStatesCount ( ) const
inline

Definition at line 2180 of file Shader.hpp.

◆ reset()

void vl::Shader::reset ( )
inline

Disables everything, erases all the render states, erases all the uniforms.

Definition at line 1956 of file Shader.hpp.

◆ scissor() [1/2]

const Scissor* vl::Shader::scissor ( ) const
inline

Returns the Scissor to be used when rendering an Actor.

See also

Definition at line 2309 of file Shader.hpp.

Referenced by vl::OcclusionCullRenderer::render_pass2(), and vl::Renderer::renderRaw().

◆ scissor() [2/2]

Scissor* vl::Shader::scissor ( )
inline

Returns the Scissor to be used when rendering an Actor.

See also

Definition at line 2318 of file Shader.hpp.

◆ setEnableSet()

void vl::Shader::setEnableSet ( EnableSet *  es)
inline

Definition at line 2275 of file Shader.hpp.

Referenced by vl::DaeLoader::load().

◆ setLastUpdateTime()

void vl::Shader::setLastUpdateTime ( real  time)
inline

Used internally.

Definition at line 2333 of file Shader.hpp.

Referenced by vl::Rendering::fillRenderQueue().

◆ setRenderState() [1/2]

void vl::Shader::setRenderState ( RenderStateNonIndexed *  renderstate)
inline

◆ setRenderState() [2/2]

void vl::Shader::setRenderState ( RenderState *  renderstate,
int  index 
)
inline

Definition at line 2174 of file Shader.hpp.

◆ setRenderStateSet()

void vl::Shader::setRenderStateSet ( RenderStateSet *  rss)
inline

Definition at line 2277 of file Shader.hpp.

Referenced by vl::DaeLoader::load().

◆ setScissor()

void vl::Shader::setScissor ( Scissor *  scissor)
inline

Sets the Scissor to be used when rendering an Actor.

Note
You can also define a Scissor on a per-Actor basis using the function Actor::setScissor(). In case both the Shader's and the Actor's Scissor are defined the Actor's Scissor is used.
See also

Definition at line 2300 of file Shader.hpp.

◆ setShaderAnimator()

void vl::Shader::setShaderAnimator ( ShaderAnimator *  animator)
inline

Installs the ShaderAnimator used to update/animate a Shader (see vl::ShaderAnimator documentation).

Definition at line 2321 of file Shader.hpp.

◆ setUniform()

void vl::Shader::setUniform ( Uniform *  uniform)
inline

Equivalent to gocUniformSet()->setUniform(...)

Definition at line 2202 of file Shader.hpp.

References VL_CHECK.

Referenced by vlX::VLXClassWrapper_Shader::importShader(), vl::ShaderNode::inherit(), and vl::Terrain::init().

◆ setUniformSet()

void vl::Shader::setUniformSet ( UniformSet *  us)
inline

◆ shaderAnimator() [1/2]

ShaderAnimator* vl::Shader::shaderAnimator ( )
inline

Returns the ShaderAnimator used to update/animate a Shader (see vl::ShaderAnimator documentation).

Definition at line 2324 of file Shader.hpp.

Referenced by vl::Rendering::fillRenderQueue().

◆ shaderAnimator() [2/2]

const ShaderAnimator* vl::Shader::shaderAnimator ( ) const
inline

Returns the ShaderAnimator used to update/animate a Shader (see vl::ShaderAnimator documentation).

Definition at line 2327 of file Shader.hpp.

◆ shallowCopy()

ref<Shader> vl::Shader::shallowCopy ( ) const
inline

Returns the shallow copy of a Shader.

Definition at line 1846 of file Shader.hpp.

References shallowCopyFrom().

◆ shallowCopyFrom()

Shader& vl::Shader::shallowCopyFrom ( const Shader &  other)
inline

Performs a shallow copy from the given Shader.

The render states and the uniforms are shallow-copied however the Shader retains its own RenderStateSet, UniformSet and EnableSet.

Definition at line 1855 of file Shader.hpp.

References mEnableSet, mRenderStateSet, mScissor, mShaderAnimator, mUniformSet, NULL, vl::RenderStateSet::shallowCopyFrom(), and vl::UniformSet::shallowCopyFrom().

Referenced by shallowCopy().

◆ uniforms()

const std::vector< ref<Uniform> >& vl::Shader::uniforms ( ) const
inline

Equivalent to gocUniformSet()->uniforms(...)

Definition at line 2205 of file Shader.hpp.

Referenced by vlX::VLXClassWrapper_Shader::exportShader().

Member Data Documentation

◆ mEnableSet

ref<EnableSet> vl::Shader::mEnableSet
protected

Definition at line 2347 of file Shader.hpp.

Referenced by deepCopyFrom(), and shallowCopyFrom().

◆ mLastUpdateTime

real vl::Shader::mLastUpdateTime
protected

Definition at line 2351 of file Shader.hpp.

Referenced by Shader().

◆ mRenderStateSet

ref<RenderStateSet> vl::Shader::mRenderStateSet
protected

Definition at line 2346 of file Shader.hpp.

Referenced by deepCopyFrom(), and shallowCopyFrom().

◆ mScissor

ref<Scissor> vl::Shader::mScissor
protected

Definition at line 2349 of file Shader.hpp.

Referenced by deepCopyFrom(), and shallowCopyFrom().

◆ mShaderAnimator

ref<ShaderAnimator> vl::Shader::mShaderAnimator
protected

Definition at line 2350 of file Shader.hpp.

Referenced by deepCopyFrom(), and shallowCopyFrom().

◆ mUniformSet

ref<UniformSet> vl::Shader::mUniformSet
protected

Definition at line 2348 of file Shader.hpp.

Referenced by deepCopyFrom(), and shallowCopyFrom().


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