# Visualization Library

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

[Home] [Tutorials] [All Classes] [Grouped Classes]

Public Member Functions | Protected Attributes

# 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:

List of all members.

## Public Member Functions

| Shader ()
| Constructor.
virtual | ~Shader ()
| Destructor.
ref< Shader > | shallowCopy () const
| Returns the shallow copy of a Shader.
Shader & | shallowCopyFrom (const Shader &other)
| Performs a shallow copy from the given Shader.
ref< Shader > | deepCopy () const
| Returns the deep copy of a Shader.
Shader & | deepCopyFrom (const Shader &other)
| Performs a deep copy from the given Shader.
void | reset ()
| Disables everything, erases all the render states, erases all the uniforms.
GLSLProgram * | gocGLSLProgram ()
| Gets or creates a GLSLProgram and returns it.
const GLSLProgram * | getGLSLProgram () const
| Returns a GLSLProgram if it exists or NULL otherwise.
GLSLProgram * | getGLSLProgram ()
| Returns a GLSLProgram if it exists or NULL otherwise.
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.
void | eraseRenderState (RenderState *rs, int index)
void | eraseAllRenderStates ()
const GLSLProgram * | glslProgram () const
| Returns the GLSLProgram associated to a Shader (if any)
GLSLProgram * | glslProgram ()
| Returns the GLSLProgram associated to a Shader (if any)
void | setUniform (Uniform *uniform)
| Equivalent to gocUniformSet()->setUniform(...)
const std::vector< ref < Uniform > > & | uniforms () const
| Equivalent to gocUniformSet()->uniforms(...)
void | eraseUniform (const char *name)
| Equivalent to gocUniformSet()->eraseUniform(...)
void | eraseUniform (const Uniform *uniform)
| Equivalent to gocUniformSet()->eraseUniform(...)
void | eraseAllUniforms ()
| Equivalent to gocUniformSet()->eraseAllUniforms(...)
Uniform * | gocUniform (const char *name)
| Equivalent to gocUniformSet()->gocUniform(...)
Uniform * | getUniform (const char *name)
| Equivalent to gocUniformSet()->getUniform(...)
const Uniform * | getUniform (const char *name) const
| Equivalent to gocUniformSet()->getUniform(...)
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)
UniformSet * | getUniformSet ()
| Returns the UniformSet installed.
const UniformSet * | getUniformSet () const
| Returns the UniformSet installed.
void | setEnableSet (EnableSet *es)
void | setRenderStateSet (RenderStateSet *rss)
void | setUniformSet (UniformSet *us)
| Installs a new UniformSet.
void | setScissor (Scissor *scissor)
| Sets the Scissor to be used when rendering an Actor.
const Scissor * | scissor () const
| Returns the Scissor to be used when rendering an Actor.
Scissor * | scissor ()
| Returns the Scissor to be used when rendering an Actor.
void | setShaderAnimator (ShaderAnimator *animator)
| Installs the ShaderAnimator used to update/animate a Shader (see vl::ShaderAnimator documentation).
ShaderAnimator * | shaderAnimator ()
| Returns the ShaderAnimator used to update/animate a Shader (see vl::ShaderAnimator documentation).
const ShaderAnimator * | shaderAnimator () const
| Returns the ShaderAnimator used to update/animate a Shader (see vl::ShaderAnimator documentation).
real | lastUpdateTime () const
| Last time this Actor was animated/updated using a shaderAnimator().
void | setLastUpdateTime (real time)
| Used internally.

## Protected Attributes

ref< RenderStateSet > | mRenderStateSet
ref< EnableSet > | mEnableSet
ref< UniformSet > | mUniformSet
ref< Scissor > | mScissor
ref< ShaderAnimator > | mShaderAnimator
real | mLastUpdateTime

## 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 1838 of file Shader.hpp.

## Constructor & Destructor Documentation

Shader::Shader | ( | ) |

Constructor.

Definition at line 45 of file Shader.cpp.

References mLastUpdateTime, NULL, and VL_DEBUG_SET_OBJECT_NAME.

Shader::~Shader | ( | ) | `[virtual]`

Destructor.

Definition at line 55 of file Shader.cpp.

## Member Function Documentation

ref<Shader> vl::Shader::shallowCopy | ( | ) | const`[inline]`

Returns the shallow copy of a Shader.

Definition at line 1854 of file Shader.hpp.

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 1863 of file Shader.hpp.

References vl::ref< T >::get(), mEnableSet, mRenderStateSet, mScissor, mShaderAnimator, mUniformSet, NULL, vl::UniformSet::shallowCopyFrom(), and vl::RenderStateSet::shallowCopyFrom().

ref<Shader> vl::Shader::deepCopy | ( | ) | const`[inline]`

Returns the deep copy of a Shader.

Definition at line 1909 of file Shader.hpp.

Shader& vl::Shader::deepCopyFrom | ( | const Shader & | other ) | `[inline]`

Performs a deep copy from the given Shader.

Definition at line 1917 of file Shader.hpp.

References vl::UniformSet::deepCopyFrom(), vl::RenderStateSet::deepCopyFrom(), vl::ref< T >::get(), mEnableSet, mRenderStateSet, mScissor, mShaderAnimator, mUniformSet, and NULL.

void vl::Shader::reset | ( | ) | `[inline]`

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

Definition at line 1964 of file Shader.hpp.

GLSLProgram * Shader::gocGLSLProgram | ( | ) |

Gets or creates a GLSLProgram and returns it.

Definition at line 89 of file Shader.cpp.

References GET_OR_CREATE.

const GLSLProgram * Shader::getGLSLProgram | ( | ) | const

Returns a GLSLProgram if it exists or NULL otherwise.

Definition at line 59 of file Shader.cpp.

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

Referenced by vl::SlicedVolume::onActorRenderStarted(), vl::RaycastVolume::onActorRenderStarted(), vl::SlicedVolume::updateUniforms(), and vl::RaycastVolume::updateUniforms().

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.

PixelTransfer * Shader::gocPixelTransfer | ( | ) |

Definition at line 91 of file Shader.cpp.

References GET_OR_CREATE.

const PixelTransfer* vl::Shader::getPixelTransfer | ( | ) | const`[inline]`

Definition at line 1983 of file Shader.hpp.

References NULL, and vl::RS_PixelTransfer.

PixelTransfer* vl::Shader::getPixelTransfer | ( | ) | `[inline]`

Definition at line 1984 of file Shader.hpp.

References NULL, and vl::RS_PixelTransfer.

Hint * Shader::gocHint | ( | ) |

Definition at line 93 of file Shader.cpp.

References GET_OR_CREATE.

const Hint* vl::Shader::getHint | ( | ) | const`[inline]`

Definition at line 1987 of file Shader.hpp.

References NULL, and vl::RS_Hint.

Hint* vl::Shader::getHint | ( | ) | `[inline]`

Definition at line 1988 of file Shader.hpp.

References NULL, and vl::RS_Hint.

CullFace * Shader::gocCullFace | ( | ) |

Definition at line 95 of file Shader.cpp.

References GET_OR_CREATE.

const CullFace* vl::Shader::getCullFace | ( | ) | const`[inline]`

Definition at line 1991 of file Shader.hpp.

References NULL, and vl::RS_CullFace.

CullFace* vl::Shader::getCullFace | ( | ) | `[inline]`

Definition at line 1992 of file Shader.hpp.

References NULL, and vl::RS_CullFace.

FrontFace * Shader::gocFrontFace | ( | ) |

Definition at line 97 of file Shader.cpp.

References GET_OR_CREATE.

const FrontFace* vl::Shader::getFrontFace | ( | ) | const`[inline]`

Definition at line 1995 of file Shader.hpp.

References NULL, and vl::RS_FrontFace.

FrontFace* vl::Shader::getFrontFace | ( | ) | `[inline]`

Definition at line 1996 of file Shader.hpp.

References NULL, and vl::RS_FrontFace.

DepthFunc * Shader::gocDepthFunc | ( | ) |

Definition at line 99 of file Shader.cpp.

References GET_OR_CREATE.

const DepthFunc* vl::Shader::getDepthFunc | ( | ) | const`[inline]`

Definition at line 1999 of file Shader.hpp.

References NULL, and vl::RS_DepthFunc.

DepthFunc* vl::Shader::getDepthFunc | ( | ) | `[inline]`

Definition at line 2000 of file Shader.hpp.

References NULL, and vl::RS_DepthFunc.

DepthMask * Shader::gocDepthMask | ( | ) |

Definition at line 101 of file Shader.cpp.

References GET_OR_CREATE.

const DepthMask* vl::Shader::getDepthMask | ( | ) | const`[inline]`

Definition at line 2003 of file Shader.hpp.

References NULL, and vl::RS_DepthMask.

DepthMask* vl::Shader::getDepthMask | ( | ) | `[inline]`

Definition at line 2004 of file Shader.hpp.

References NULL, and vl::RS_DepthMask.

Color * Shader::gocColor | ( | ) |

Definition at line 103 of file Shader.cpp.

References GET_OR_CREATE.

const Color* vl::Shader::getColor | ( | ) | const`[inline]`

Definition at line 2007 of file Shader.hpp.

References NULL, and vl::RS_Color.

Color* vl::Shader::getColor | ( | ) | `[inline]`

Definition at line 2008 of file Shader.hpp.

References NULL, and vl::RS_Color.

SecondaryColor * Shader::gocSecondaryColor | ( | ) |

Definition at line 105 of file Shader.cpp.

References GET_OR_CREATE.

const SecondaryColor* vl::Shader::getSecondaryColor | ( | ) | const`[inline]`

Definition at line 2011 of file Shader.hpp.

References NULL, and vl::RS_SecondaryColor.

SecondaryColor* vl::Shader::getSecondaryColor | ( | ) | `[inline]`

Definition at line 2012 of file Shader.hpp.

References NULL, and vl::RS_SecondaryColor.

Normal * Shader::gocNormal | ( | ) |

Definition at line 107 of file Shader.cpp.

References GET_OR_CREATE.

const Normal* vl::Shader::getNormal | ( | ) | const`[inline]`

Definition at line 2015 of file Shader.hpp.

References NULL, and vl::RS_Normal.

Normal* vl::Shader::getNormal | ( | ) | `[inline]`

Definition at line 2016 of file Shader.hpp.

References NULL, and vl::RS_Normal.

ColorMask * Shader::gocColorMask | ( | ) |

Definition at line 109 of file Shader.cpp.

References GET_OR_CREATE.

const ColorMask* vl::Shader::getColorMask | ( | ) | const`[inline]`

Definition at line 2019 of file Shader.hpp.

References NULL, and vl::RS_ColorMask.

ColorMask* vl::Shader::getColorMask | ( | ) | `[inline]`

Definition at line 2020 of file Shader.hpp.

References NULL, and vl::RS_ColorMask.

PolygonMode * Shader::gocPolygonMode | ( | ) |

Definition at line 111 of file Shader.cpp.

References GET_OR_CREATE.

const PolygonMode* vl::Shader::getPolygonMode | ( | ) | const`[inline]`

Definition at line 2023 of file Shader.hpp.

References NULL, and vl::RS_PolygonMode.

PolygonMode* vl::Shader::getPolygonMode | ( | ) | `[inline]`

Definition at line 2024 of file Shader.hpp.

References NULL, and vl::RS_PolygonMode.

ShadeModel * Shader::gocShadeModel | ( | ) |

Definition at line 113 of file Shader.cpp.

References GET_OR_CREATE.

const ShadeModel* vl::Shader::getShadeModel | ( | ) | const`[inline]`

Definition at line 2027 of file Shader.hpp.

References NULL, and vl::RS_ShadeModel.

ShadeModel* vl::Shader::getShadeModel | ( | ) | `[inline]`

Definition at line 2028 of file Shader.hpp.

References NULL, and vl::RS_ShadeModel.

BlendEquation * Shader::gocBlendEquation | ( | ) |

Definition at line 115 of file Shader.cpp.

References GET_OR_CREATE.

const BlendEquation* vl::Shader::getBlendEquation | ( | ) | const`[inline]`

Definition at line 2031 of file Shader.hpp.

References NULL, and vl::RS_BlendEquation.

BlendEquation* vl::Shader::getBlendEquation | ( | ) | `[inline]`

Definition at line 2032 of file Shader.hpp.

References NULL, and vl::RS_BlendEquation.

AlphaFunc * Shader::gocAlphaFunc | ( | ) |

Definition at line 117 of file Shader.cpp.

References GET_OR_CREATE.

const AlphaFunc* vl::Shader::getAlphaFunc | ( | ) | const`[inline]`

Definition at line 2035 of file Shader.hpp.

References NULL, and vl::RS_AlphaFunc.

AlphaFunc* vl::Shader::getAlphaFunc | ( | ) | `[inline]`

Definition at line 2036 of file Shader.hpp.

References NULL, and vl::RS_AlphaFunc.

Material * Shader::gocMaterial | ( | ) |

Definition at line 119 of file Shader.cpp.

References GET_OR_CREATE.

const Material* vl::Shader::getMaterial | ( | ) | const`[inline]`

Definition at line 2039 of file Shader.hpp.

References NULL, and vl::RS_Material.

Material* vl::Shader::getMaterial | ( | ) | `[inline]`

Definition at line 2040 of file Shader.hpp.

References NULL, and vl::RS_Material.

LightModel * Shader::gocLightModel | ( | ) |

Definition at line 121 of file Shader.cpp.

References GET_OR_CREATE.

const LightModel* vl::Shader::getLightModel | ( | ) | const`[inline]`

Definition at line 2043 of file Shader.hpp.

References NULL, and vl::RS_LightModel.

LightModel* vl::Shader::getLightModel | ( | ) | `[inline]`

Definition at line 2044 of file Shader.hpp.

References NULL, and vl::RS_LightModel.

Fog * Shader::gocFog | ( | ) |

Definition at line 123 of file Shader.cpp.

References GET_OR_CREATE.

const Fog* vl::Shader::getFog | ( | ) | const`[inline]`

Definition at line 2047 of file Shader.hpp.

References NULL, and vl::RS_Fog.

Fog* vl::Shader::getFog | ( | ) | `[inline]`

Definition at line 2048 of file Shader.hpp.

References NULL, and vl::RS_Fog.

PolygonOffset * Shader::gocPolygonOffset | ( | ) |

Definition at line 125 of file Shader.cpp.

References GET_OR_CREATE.

const PolygonOffset* vl::Shader::getPolygonOffset | ( | ) | const`[inline]`

Definition at line 2051 of file Shader.hpp.

References NULL, and vl::RS_PolygonOffset.

PolygonOffset* vl::Shader::getPolygonOffset | ( | ) | `[inline]`

Definition at line 2052 of file Shader.hpp.

References NULL, and vl::RS_PolygonOffset.

LogicOp * Shader::gocLogicOp | ( | ) |

Definition at line 127 of file Shader.cpp.

References GET_OR_CREATE.

const LogicOp* vl::Shader::getLogicOp | ( | ) | const`[inline]`

Definition at line 2055 of file Shader.hpp.

References NULL, and vl::RS_LogicOp.

LogicOp* vl::Shader::getLogicOp | ( | ) | `[inline]`

Definition at line 2056 of file Shader.hpp.

References NULL, and vl::RS_LogicOp.

DepthRange * Shader::gocDepthRange | ( | ) |

Definition at line 129 of file Shader.cpp.

References GET_OR_CREATE.

const DepthRange* vl::Shader::getDepthRange | ( | ) | const`[inline]`

Definition at line 2059 of file Shader.hpp.

References NULL, and vl::RS_DepthRange.

DepthRange* vl::Shader::getDepthRange | ( | ) | `[inline]`

Definition at line 2060 of file Shader.hpp.

References NULL, and vl::RS_DepthRange.

LineWidth * Shader::gocLineWidth | ( | ) |

Definition at line 131 of file Shader.cpp.

References GET_OR_CREATE.

const LineWidth* vl::Shader::getLineWidth | ( | ) | const`[inline]`

Definition at line 2063 of file Shader.hpp.

References NULL, and vl::RS_LineWidth.

LineWidth* vl::Shader::getLineWidth | ( | ) | `[inline]`

Definition at line 2064 of file Shader.hpp.

References NULL, and vl::RS_LineWidth.

PointSize * Shader::gocPointSize | ( | ) |

Definition at line 133 of file Shader.cpp.

References GET_OR_CREATE.

const PointSize* vl::Shader::getPointSize | ( | ) | const`[inline]`

Definition at line 2067 of file Shader.hpp.

References NULL, and vl::RS_PointSize.

PointSize* vl::Shader::getPointSize | ( | ) | `[inline]`

Definition at line 2068 of file Shader.hpp.

References NULL, and vl::RS_PointSize.

LineStipple * Shader::gocLineStipple | ( | ) |

Definition at line 135 of file Shader.cpp.

References GET_OR_CREATE.

const LineStipple* vl::Shader::getLineStipple | ( | ) | const`[inline]`

Definition at line 2071 of file Shader.hpp.

References NULL, and vl::RS_LineStipple.

LineStipple* vl::Shader::getLineStipple | ( | ) | `[inline]`

Definition at line 2072 of file Shader.hpp.

References NULL, and vl::RS_LineStipple.

PolygonStipple * Shader::gocPolygonStipple | ( | ) |

Definition at line 137 of file Shader.cpp.

References GET_OR_CREATE.

const PolygonStipple* vl::Shader::getPolygonStipple | ( | ) | const`[inline]`

Definition at line 2075 of file Shader.hpp.

References NULL, and vl::RS_PolygonStipple.

PolygonStipple* vl::Shader::getPolygonStipple | ( | ) | `[inline]`

Definition at line 2076 of file Shader.hpp.

References NULL, and vl::RS_PolygonStipple.

PointParameter * Shader::gocPointParameter | ( | ) |

Definition at line 139 of file Shader.cpp.

References GET_OR_CREATE.

const PointParameter* vl::Shader::getPointParameter | ( | ) | const`[inline]`

Definition at line 2079 of file Shader.hpp.

References NULL, and vl::RS_PointParameter.

PointParameter* vl::Shader::getPointParameter | ( | ) | `[inline]`

Definition at line 2080 of file Shader.hpp.

References NULL, and vl::RS_PointParameter.

StencilFunc * Shader::gocStencilFunc | ( | ) |

Definition at line 141 of file Shader.cpp.

References GET_OR_CREATE.

const StencilFunc* vl::Shader::getStencilFunc | ( | ) | const`[inline]`

Definition at line 2083 of file Shader.hpp.

References NULL, and vl::RS_StencilFunc.

StencilFunc* vl::Shader::getStencilFunc | ( | ) | `[inline]`

Definition at line 2084 of file Shader.hpp.

References NULL, and vl::RS_StencilFunc.

StencilOp * Shader::gocStencilOp | ( | ) |

Definition at line 143 of file Shader.cpp.

References GET_OR_CREATE.

const StencilOp* vl::Shader::getStencilOp | ( | ) | const`[inline]`

Definition at line 2087 of file Shader.hpp.

References NULL, and vl::RS_StencilOp.

StencilOp* vl::Shader::getStencilOp | ( | ) | `[inline]`

Definition at line 2088 of file Shader.hpp.

References NULL, and vl::RS_StencilOp.

StencilMask * Shader::gocStencilMask | ( | ) |

Definition at line 145 of file Shader.cpp.

References GET_OR_CREATE.

const StencilMask* vl::Shader::getStencilMask | ( | ) | const`[inline]`

Definition at line 2091 of file Shader.hpp.

References NULL, and vl::RS_StencilMask.

StencilMask* vl::Shader::getStencilMask | ( | ) | `[inline]`

Definition at line 2092 of file Shader.hpp.

References NULL, and vl::RS_StencilMask.

BlendColor * Shader::gocBlendColor | ( | ) |

Definition at line 147 of file Shader.cpp.

References GET_OR_CREATE.

const BlendColor* vl::Shader::getBlendColor | ( | ) | const`[inline]`

Definition at line 2095 of file Shader.hpp.

References NULL, and vl::RS_BlendColor.

BlendColor* vl::Shader::getBlendColor | ( | ) | `[inline]`

Definition at line 2096 of file Shader.hpp.

References NULL, and vl::RS_BlendColor.

BlendFunc * Shader::gocBlendFunc | ( | ) |

Definition at line 149 of file Shader.cpp.

References GET_OR_CREATE.

const BlendFunc* vl::Shader::getBlendFunc | ( | ) | const`[inline]`

Definition at line 2099 of file Shader.hpp.

References NULL, and vl::RS_BlendFunc.

BlendFunc* vl::Shader::getBlendFunc | ( | ) | `[inline]`

Definition at line 2100 of file Shader.hpp.

References NULL, and vl::RS_BlendFunc.

SampleCoverage * Shader::gocSampleCoverage | ( | ) |

Definition at line 151 of file Shader.cpp.

References GET_OR_CREATE.

const SampleCoverage* vl::Shader::getSampleCoverage | ( | ) | const`[inline]`

Definition at line 2103 of file Shader.hpp.

References NULL, and vl::RS_SampleCoverage.

SampleCoverage* vl::Shader::getSampleCoverage | ( | ) | `[inline]`

Definition at line 2104 of file Shader.hpp.

References NULL, and vl::RS_SampleCoverage.

VertexAttrib * Shader::gocVertexAttrib | ( | int | attr_index ) |

Definition at line 153 of file Shader.cpp.

References GET_OR_CREATE_IDX.

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

Definition at line 155 of file Shader.cpp.

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

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

Definition at line 157 of file Shader.cpp.

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

Light * Shader::gocLight | ( | int | light_index ) |

Definition at line 159 of file Shader.cpp.

References GET_OR_CREATE_IDX.

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

Definition at line 161 of file Shader.cpp.

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

Referenced by vl::SlicedVolume::updateUniforms(), and vl::RaycastVolume::updateUniforms().

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

Definition at line 163 of file Shader.cpp.

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

ClipPlane * Shader::gocClipPlane | ( | int | plane_index ) |

Definition at line 165 of file Shader.cpp.

References GET_OR_CREATE_IDX.

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

Definition at line 167 of file Shader.cpp.

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

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

Definition at line 169 of file Shader.cpp.

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

TextureSampler * Shader::gocTextureSampler | ( | int | unit_index ) |

Definition at line 171 of file Shader.cpp.

References GET_OR_CREATE_IDX.

const TextureSampler* vl::Shader::getTextureSampler | ( | int | unit_index ) | const`[inline]`

Definition at line 2136 of file Shader.hpp.

References vl::RS_TextureSampler.

TextureSampler* vl::Shader::getTextureSampler | ( | int | unit_index ) | `[inline]`

Definition at line 2138 of file Shader.hpp.

References vl::RS_TextureSampler.

TexEnv * Shader::gocTexEnv | ( | int | unit_index ) |

Definition at line 175 of file Shader.cpp.

References GET_OR_CREATE_IDX.

const TexEnv* vl::Shader::getTexEnv | ( | int | unit_index ) | const`[inline]`

Definition at line 2144 of file Shader.hpp.

References vl::RS_TexEnv.

TexEnv* vl::Shader::getTexEnv | ( | int | unit_index ) | `[inline]`

Definition at line 2146 of file Shader.hpp.

References vl::RS_TexEnv.

TexGen * Shader::gocTexGen | ( | int | unit_index ) |

Definition at line 173 of file Shader.cpp.

References GET_OR_CREATE_IDX.

const TexGen* vl::Shader::getTexGen | ( | int | unit_index ) | const`[inline]`

Definition at line 2152 of file Shader.hpp.

References vl::RS_TexGen.

TexGen* vl::Shader::getTexGen | ( | int | unit_index ) | `[inline]`

Definition at line 2154 of file Shader.hpp.

References vl::RS_TexGen.

TextureMatrix * Shader::gocTextureMatrix | ( | int | unit_index ) |

Definition at line 177 of file Shader.cpp.

References GET_OR_CREATE_IDX.

const TextureMatrix* vl::Shader::getTextureMatrix | ( | int | unit_index ) | const`[inline]`

Definition at line 2160 of file Shader.hpp.

References vl::RS_TextureMatrix.

TextureMatrix* vl::Shader::getTextureMatrix | ( | int | unit_index ) | `[inline]`

Definition at line 2162 of file Shader.hpp.

References vl::RS_TextureMatrix.

void vl::Shader::enable | ( | EEnable | capability ) | `[inline]`

Definition at line 2166 of file Shader.hpp.

Referenced by vl::VLXClassWrapper_Shader::importShader(), vl::DaeLoader::load(), and vl::PlyLoader::loadPly().

void vl::Shader::disable | ( | EEnable | capability ) | `[inline]`

Definition at line 2168 of file Shader.hpp.

const std::vector<EEnable>& vl::Shader::enables | ( | ) | const`[inline]`

Definition at line 2170 of file Shader.hpp.

int vl::Shader::isEnabled | ( | EEnable | capability ) | const`[inline]`

Definition at line 2172 of file Shader.hpp.

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

void vl::Shader::disableAll | ( | ) | `[inline]`

Definition at line 2174 of file Shader.hpp.

bool vl::Shader::isBlendingEnabled | ( | ) | const`[inline]`

Definition at line 2176 of file Shader.hpp.

Referenced by vl::RenderQueueSorterAggressive::confirmZCameraDistanceNeed(), vl::RenderQueueSorterStandard::confirmZCameraDistanceNeed(), vl::RenderQueueSorterAggressive::operator()(), vl::RenderQueueSorterOcclusion::operator()(), and vl::RenderQueueSorterStandard::operator()().

void vl::Shader::setRenderState | ( | RenderStateNonIndexed * | renderstate ) | `[inline]`

Definition at line 2180 of file Shader.hpp.

Referenced by vl::VLXClassWrapper_Shader::importShader().

void vl::Shader::setRenderState | ( | RenderState * | renderstate,
|  | int | index
| ) |  | `[inline]`

Definition at line 2182 of file Shader.hpp.

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

Definition at line 2184 of file Shader.hpp.

References NULL.

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

Definition at line 2186 of file Shader.hpp.

size_t vl::Shader::renderStatesCount | ( | ) | const`[inline]`

Definition at line 2188 of file Shader.hpp.

const RenderStateSlot* vl::Shader::renderStates | ( | ) | const`[inline]`

Definition at line 2190 of file Shader.hpp.

RenderStateSlot* vl::Shader::renderStates | ( | ) | `[inline]`

Definition at line 2192 of file Shader.hpp.

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 2195 of file Shader.hpp.

void vl::Shader::eraseRenderState | ( | RenderState * | rs,
|  | int | index
| ) |  | `[inline]`

Definition at line 2197 of file Shader.hpp.

References vl::RenderState::type().

void vl::Shader::eraseAllRenderStates | ( | ) | `[inline]`

Definition at line 2199 of file Shader.hpp.

const GLSLProgram* vl::Shader::glslProgram | ( | ) | const`[inline]`

Returns the GLSLProgram associated to a Shader (if any)

Definition at line 2202 of file Shader.hpp.

References NULL.

Referenced by vl::Rendering::fillRenderQueue(), vl::MorphingCallback::onActorRenderStarted(), vl::RenderQueueSorterAggressive::operator()(), and vl::Renderer::render().

GLSLProgram* vl::Shader::glslProgram | ( | ) | `[inline]`

Returns the GLSLProgram associated to a Shader (if any)

Definition at line 2205 of file Shader.hpp.

void vl::Shader::setUniform | ( | Uniform * | uniform ) | `[inline]`

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

Definition at line 2210 of file Shader.hpp.

References VL_CHECK.

Referenced by vl::VLXClassWrapper_Shader::importShader().

const std::vector< ref<Uniform> >& vl::Shader::uniforms | ( | ) | const`[inline]`

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

Definition at line 2213 of file Shader.hpp.

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

void vl::Shader::eraseUniform | ( | const char * | name ) | `[inline]`

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

Definition at line 2216 of file Shader.hpp.

void vl::Shader::eraseUniform | ( | const Uniform * | uniform ) | `[inline]`

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

Definition at line 2219 of file Shader.hpp.

void vl::Shader::eraseAllUniforms | ( | ) | `[inline]`

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

Definition at line 2222 of file Shader.hpp.

Uniform* vl::Shader::gocUniform | ( | const char * | name ) | `[inline]`

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

Definition at line 2225 of file Shader.hpp.

Uniform* vl::Shader::getUniform | ( | const char * | name ) | `[inline]`

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

Definition at line 2228 of file Shader.hpp.

References vl::Uniform::getUniform().

const Uniform* vl::Shader::getUniform | ( | const char * | name ) | const`[inline]`

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

Definition at line 2231 of file Shader.hpp.

References vl::Uniform::getUniform().

EnableSet* vl::Shader::gocEnableSet | ( | ) | `[inline]`

Definition at line 2235 of file Shader.hpp.

EnableSet* vl::Shader::getEnableSet | ( | ) | `[inline]`

Definition at line 2237 of file Shader.hpp.

Referenced by vl::VLXClassWrapper_Shader::exportShader(), vl::DaeLoader::load(), vl::RenderQueueSorterAggressive::operator()(), and vl::Renderer::render().

const EnableSet* vl::Shader::getEnableSet | ( | ) | const`[inline]`

Definition at line 2239 of file Shader.hpp.

RenderStateSet* vl::Shader::gocRenderStateSet | ( | ) | `[inline]`

Definition at line 2241 of file Shader.hpp.

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

RenderStateSet* vl::Shader::getRenderStateSet | ( | ) | `[inline]`

Definition at line 2243 of file Shader.hpp.

Referenced by vl::VLXClassWrapper_Shader::exportShader(), getClipPlane(), getGLSLProgram(), getLight(), getVertexAttrib(), vl::DaeLoader::load(), vl::RenderQueueSorterAggressive::operator()(), and vl::Renderer::render().

const RenderStateSet* vl::Shader::getRenderStateSet | ( | ) | const`[inline]`

Definition at line 2245 of file Shader.hpp.

UniformSet* vl::Shader::gocUniformSet | ( | ) | `[inline]`

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

See also:
  - setUniform()
  - uniforms()
  - eraseUniform(const char* name)
  - eraseUniform(const Uniform* uniform)
  - eraseAllUniforms()
  - getUniform()

Definition at line 2257 of file Shader.hpp.

UniformSet* vl::Shader::getUniformSet | ( | ) | `[inline]`

Returns the UniformSet installed.

See also:
  - setUniform()
  - uniforms()
  - eraseUniform(const char* name)
  - eraseUniform(const Uniform* uniform)
  - eraseAllUniforms()
  - getUniform()

Definition at line 2269 of file Shader.hpp.

Referenced by vl::VLXClassWrapper_Shader::exportShader(), and vl::Renderer::render().

const UniformSet* vl::Shader::getUniformSet | ( | ) | const`[inline]`

Returns the UniformSet installed.

See also:
  - setUniform()
  - uniforms()
  - eraseUniform(const char* name)
  - eraseUniform(const Uniform* uniform)
  - eraseAllUniforms()
  - getUniform()

Definition at line 2281 of file Shader.hpp.

void vl::Shader::setEnableSet | ( | EnableSet * | es ) | `[inline]`

Definition at line 2283 of file Shader.hpp.

void vl::Shader::setRenderStateSet | ( | RenderStateSet * | rss ) | `[inline]`

Definition at line 2285 of file Shader.hpp.

void vl::Shader::setUniformSet | ( | UniformSet * | us ) | `[inline]`

Installs a new UniformSet.

See also:
  - setUniform()
  - uniforms()
  - eraseUniform(const char* name)
  - eraseUniform(const Uniform* uniform)
  - eraseAllUniforms()
  - getUniform()

Definition at line 2297 of file Shader.hpp.

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:
  - Scissor
  - Actor::setScissor()

Definition at line 2308 of file Shader.hpp.

const Scissor* vl::Shader::scissor | ( | ) | const`[inline]`

Returns the Scissor to be used when rendering an Actor.

See also:
  - Scissor
  - Shader::setScissor()
  - Actor::setScissor()

Definition at line 2317 of file Shader.hpp.

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

Scissor* vl::Shader::scissor | ( | ) | `[inline]`

Returns the Scissor to be used when rendering an Actor.

See also:
  - Scissor
  - Shader::setScissor()
  - Actor::setScissor()

Definition at line 2326 of file Shader.hpp.

void vl::Shader::setShaderAnimator | ( | ShaderAnimator * | animator ) | `[inline]`

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

Definition at line 2329 of file Shader.hpp.

ShaderAnimator* vl::Shader::shaderAnimator | ( | ) | `[inline]`

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

Definition at line 2332 of file Shader.hpp.

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

const ShaderAnimator* vl::Shader::shaderAnimator | ( | ) | const`[inline]`

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

Definition at line 2335 of file Shader.hpp.

real vl::Shader::lastUpdateTime | ( | ) | const`[inline]`

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

Definition at line 2338 of file Shader.hpp.

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

void vl::Shader::setLastUpdateTime | ( | real | time ) | `[inline]`

Used internally.

Definition at line 2341 of file Shader.hpp.

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

## Member Data Documentation

ref<RenderStateSet> vl::Shader::mRenderStateSet`[protected]`

Definition at line 2354 of file Shader.hpp.

Referenced by deepCopyFrom(), and shallowCopyFrom().

ref<EnableSet> vl::Shader::mEnableSet`[protected]`

Definition at line 2355 of file Shader.hpp.

Referenced by deepCopyFrom(), and shallowCopyFrom().

ref<UniformSet> vl::Shader::mUniformSet`[protected]`

Definition at line 2356 of file Shader.hpp.

Referenced by deepCopyFrom(), and shallowCopyFrom().

ref<Scissor> vl::Shader::mScissor`[protected]`

Definition at line 2357 of file Shader.hpp.

Referenced by deepCopyFrom(), and shallowCopyFrom().

ref<ShaderAnimator> vl::Shader::mShaderAnimator`[protected]`

Definition at line 2358 of file Shader.hpp.

Referenced by deepCopyFrom(), and shallowCopyFrom().

real vl::Shader::mLastUpdateTime`[protected]`

Definition at line 2359 of file Shader.hpp.

Referenced by Shader().

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

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/Shader.hpp
- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/Shader.cpp

Visualization Library v2011.09.1162 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu Jan 26 2012 00:44:53.
Permission is granted to use this page to write and publish articles regarding Visualization Library.