# 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

virtual const char * | className ()
| Returns the name of the class.
| Shader ()
| Constructor.
| Shader (const Shader &other)
| Copy constructor.
virtual | ~Shader ()
| Destructor.
Shader & | operator= (const Shader &other)
| Copy RenderStates, Enables, Uniforms and Scissor from another Shader.
Shader & | copy (const Shader &other)
| Equivalent to `"Shader& operator=(const 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 ()
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 ()
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)
TextureUnit * | gocTextureUnit (int unit_index)
const TextureUnit * | getTextureUnit (int unit_index) const
TextureUnit * | getTextureUnit (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 | blendingEnabled () const
void | setRenderState (RenderState *renderstate)
const RenderState * | renderState (ERenderState type) const
RenderState * | renderState (ERenderState type)
const std::vector< ref < RenderState > > & | renderStates () const
void | eraseRenderState (ERenderState type)
void | eraseRenderState (RenderState *rs)
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 std::string &name)
| Equivalent to gocUniformSet()->eraseUniform(...)
void | eraseUniform (const Uniform *uniform)
| Equivalent to gocUniformSet()->eraseUniform(...)
void | eraseAllUniforms ()
| Equivalent to gocUniformSet()->eraseAllUniforms(...)
Uniform * | gocUniform (const std::string &name)
| Equivalent to gocUniformSet()->gocUniform(...)
Uniform * | getUniform (const std::string &name)
| Equivalent to gocUniformSet()->getUniform(...)
const Uniform * | getUniform (const std::string &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 1218 of file Shader.hpp.

## Constructor & Destructor Documentation

Shader::Shader | ( | ) |

Constructor.

Definition at line 45 of file Shader.cpp.

References mLastUpdateTime, and VL_DEBUG_SET_OBJECT_NAME.

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

Copy constructor.

Calls `operator=(other)`.

Definition at line 1227 of file Shader.hpp.

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

Destructor.

Definition at line 55 of file Shader.cpp.

## Member Function Documentation

virtual const char* vl::Shader::className | ( | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::Object.

Definition at line 1221 of file Shader.hpp.

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

Copy RenderStates, Enables, Uniforms and Scissor from another Shader.

Note that the destination Shader still keeps its own copy of the RenderStateSet, EnableSet and UniformSet objects.

Definition at line 1234 of file Shader.hpp.

References vl::ref< T >::get(), mEnableSet, mRenderStateSet, mScissor, mShaderAnimator, mUniformSet, and vl::Object::operator=().

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

Equivalent to `"Shader& operator=(const Shader&)"`.

Definition at line 1279 of file Shader.hpp.

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

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

Definition at line 1285 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 1304 of file Shader.hpp.

References vl::RS_PixelTransfer.

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

Definition at line 1305 of file Shader.hpp.

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

References vl::RS_Hint.

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

Definition at line 1309 of file Shader.hpp.

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

References vl::RS_CullFace.

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

Definition at line 1313 of file Shader.hpp.

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

References vl::RS_FrontFace.

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

Definition at line 1317 of file Shader.hpp.

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

References vl::RS_DepthFunc.

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

Definition at line 1321 of file Shader.hpp.

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

References vl::RS_DepthMask.

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

Definition at line 1325 of file Shader.hpp.

References vl::RS_DepthMask.

ColorMask * Shader::gocColorMask | ( | ) |

Definition at line 103 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1328 of file Shader.hpp.

References vl::RS_ColorMask.

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

Definition at line 1329 of file Shader.hpp.

References vl::RS_ColorMask.

PolygonMode * Shader::gocPolygonMode | ( | ) |

Definition at line 105 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1332 of file Shader.hpp.

References vl::RS_PolygonMode.

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

Definition at line 1333 of file Shader.hpp.

References vl::RS_PolygonMode.

ShadeModel * Shader::gocShadeModel | ( | ) |

Definition at line 107 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1336 of file Shader.hpp.

References vl::RS_ShadeModel.

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

Definition at line 1337 of file Shader.hpp.

References vl::RS_ShadeModel.

BlendEquation * Shader::gocBlendEquation | ( | ) |

Definition at line 109 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1340 of file Shader.hpp.

References vl::RS_BlendEquation.

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

Definition at line 1341 of file Shader.hpp.

References vl::RS_BlendEquation.

AlphaFunc * Shader::gocAlphaFunc | ( | ) |

Definition at line 111 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1344 of file Shader.hpp.

References vl::RS_AlphaFunc.

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

Definition at line 1345 of file Shader.hpp.

References vl::RS_AlphaFunc.

Material * Shader::gocMaterial | ( | ) |

Definition at line 113 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1348 of file Shader.hpp.

References vl::RS_Material.

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

Definition at line 1349 of file Shader.hpp.

References vl::RS_Material.

LightModel * Shader::gocLightModel | ( | ) |

Definition at line 115 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1352 of file Shader.hpp.

References vl::RS_LightModel.

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

Definition at line 1353 of file Shader.hpp.

References vl::RS_LightModel.

Fog * Shader::gocFog | ( | ) |

Definition at line 117 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1356 of file Shader.hpp.

References vl::RS_Fog.

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

Definition at line 1357 of file Shader.hpp.

References vl::RS_Fog.

PolygonOffset * Shader::gocPolygonOffset | ( | ) |

Definition at line 119 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1360 of file Shader.hpp.

References vl::RS_PolygonOffset.

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

Definition at line 1361 of file Shader.hpp.

References vl::RS_PolygonOffset.

LogicOp * Shader::gocLogicOp | ( | ) |

Definition at line 121 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1364 of file Shader.hpp.

References vl::RS_LogicOp.

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

Definition at line 1365 of file Shader.hpp.

References vl::RS_LogicOp.

DepthRange * Shader::gocDepthRange | ( | ) |

Definition at line 123 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1368 of file Shader.hpp.

References vl::RS_DepthRange.

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

Definition at line 1369 of file Shader.hpp.

References vl::RS_DepthRange.

LineWidth * Shader::gocLineWidth | ( | ) |

Definition at line 125 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1372 of file Shader.hpp.

References vl::RS_LineWidth.

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

Definition at line 1373 of file Shader.hpp.

References vl::RS_LineWidth.

PointSize * Shader::gocPointSize | ( | ) |

Definition at line 127 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1376 of file Shader.hpp.

References vl::RS_PointSize.

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

Definition at line 1377 of file Shader.hpp.

References vl::RS_PointSize.

LineStipple * Shader::gocLineStipple | ( | ) |

Definition at line 129 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1380 of file Shader.hpp.

References vl::RS_LineStipple.

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

Definition at line 1381 of file Shader.hpp.

References vl::RS_LineStipple.

PolygonStipple * Shader::gocPolygonStipple | ( | ) |

Definition at line 131 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1384 of file Shader.hpp.

References vl::RS_PolygonStipple.

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

Definition at line 1385 of file Shader.hpp.

References vl::RS_PolygonStipple.

PointParameter * Shader::gocPointParameter | ( | ) |

Definition at line 133 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1388 of file Shader.hpp.

References vl::RS_PointParameter.

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

Definition at line 1389 of file Shader.hpp.

References vl::RS_PointParameter.

StencilFunc * Shader::gocStencilFunc | ( | ) |

Definition at line 135 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1392 of file Shader.hpp.

References vl::RS_StencilFunc.

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

Definition at line 1393 of file Shader.hpp.

References vl::RS_StencilFunc.

StencilOp * Shader::gocStencilOp | ( | ) |

Definition at line 137 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1396 of file Shader.hpp.

References vl::RS_StencilOp.

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

Definition at line 1397 of file Shader.hpp.

References vl::RS_StencilOp.

StencilMask * Shader::gocStencilMask | ( | ) |

Definition at line 139 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1400 of file Shader.hpp.

References vl::RS_StencilMask.

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

Definition at line 1401 of file Shader.hpp.

References vl::RS_StencilMask.

BlendColor * Shader::gocBlendColor | ( | ) |

Definition at line 141 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1404 of file Shader.hpp.

References vl::RS_BlendColor.

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

Definition at line 1405 of file Shader.hpp.

References vl::RS_BlendColor.

BlendFunc * Shader::gocBlendFunc | ( | ) |

Definition at line 143 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1408 of file Shader.hpp.

References vl::RS_BlendFunc.

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

Definition at line 1409 of file Shader.hpp.

References vl::RS_BlendFunc.

SampleCoverage * Shader::gocSampleCoverage | ( | ) |

Definition at line 145 of file Shader.cpp.

References GET_OR_CREATE.

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

Definition at line 1412 of file Shader.hpp.

References vl::RS_SampleCoverage.

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

Definition at line 1413 of file Shader.hpp.

References vl::RS_SampleCoverage.

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

Definition at line 147 of file Shader.cpp.

References GET_OR_CREATE_IDX.

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

Definition at line 149 of file Shader.cpp.

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

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

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

Definition at line 151 of file Shader.cpp.

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

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

Definition at line 153 of file Shader.cpp.

References GET_OR_CREATE_IDX.

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

Definition at line 155 of file Shader.cpp.

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

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

Definition at line 157 of file Shader.cpp.

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

TextureUnit * Shader::gocTextureUnit | ( | int | unit_index ) |

Definition at line 159 of file Shader.cpp.

References GET_OR_CREATE_IDX.

const TextureUnit* vl::Shader::getTextureUnit | ( | int | unit_index ) | const`[inline]`

Definition at line 1437 of file Shader.hpp.

References vl::RS_TextureUnit0.

TextureUnit* vl::Shader::getTextureUnit | ( | int | unit_index ) | `[inline]`

Definition at line 1439 of file Shader.hpp.

References vl::RS_TextureUnit0.

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

Definition at line 163 of file Shader.cpp.

References GET_OR_CREATE_IDX.

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

Definition at line 1445 of file Shader.hpp.

References vl::RS_TexEnv0.

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

Definition at line 1447 of file Shader.hpp.

References vl::RS_TexEnv0.

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

Definition at line 161 of file Shader.cpp.

References GET_OR_CREATE_IDX.

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

Definition at line 1453 of file Shader.hpp.

References vl::RS_TexGen0.

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

Definition at line 1455 of file Shader.hpp.

References vl::RS_TexGen0.

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

Definition at line 165 of file Shader.cpp.

References GET_OR_CREATE_IDX.

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

Definition at line 1461 of file Shader.hpp.

References vl::RS_TextureMatrix0.

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

Definition at line 1463 of file Shader.hpp.

References vl::RS_TextureMatrix0.

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

Definition at line 1467 of file Shader.hpp.

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

Definition at line 1469 of file Shader.hpp.

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

Definition at line 1471 of file Shader.hpp.

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

Definition at line 1473 of file Shader.hpp.

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

Definition at line 1475 of file Shader.hpp.

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

Definition at line 1477 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 | ( | RenderState * | renderstate ) | `[inline]`

Definition at line 1481 of file Shader.hpp.

const RenderState* vl::Shader::renderState | ( | ERenderState | type ) | const`[inline]`

Definition at line 1483 of file Shader.hpp.

RenderState* vl::Shader::renderState | ( | ERenderState | type ) | `[inline]`

Definition at line 1485 of file Shader.hpp.

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

Definition at line 1487 of file Shader.hpp.

void vl::Shader::eraseRenderState | ( | ERenderState | type ) | `[inline]`

Definition at line 1489 of file Shader.hpp.

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

Definition at line 1491 of file Shader.hpp.

References vl::RenderState::type().

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

Definition at line 1493 of file Shader.hpp.

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

Returns the GLSLProgram associated to a Shader (if any)

Definition at line 1496 of file Shader.hpp.

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

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

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

Definition at line 1504 of file Shader.hpp.

References VL_CHECK.

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

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

Definition at line 1507 of file Shader.hpp.

void vl::Shader::eraseUniform | ( | const std::string & | name ) | `[inline]`

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

Definition at line 1510 of file Shader.hpp.

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

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

Definition at line 1513 of file Shader.hpp.

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

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

Definition at line 1516 of file Shader.hpp.

Uniform* vl::Shader::gocUniform | ( | const std::string & | name ) | `[inline]`

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

Definition at line 1519 of file Shader.hpp.

Uniform* vl::Shader::getUniform | ( | const std::string & | name ) | `[inline]`

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

Definition at line 1522 of file Shader.hpp.

References vl::Uniform::getUniform().

const Uniform* vl::Shader::getUniform | ( | const std::string & | name ) | const`[inline]`

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

Definition at line 1525 of file Shader.hpp.

References vl::Uniform::getUniform().

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

Definition at line 1529 of file Shader.hpp.

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

Definition at line 1531 of file Shader.hpp.

Referenced by vl::RenderQueueSorterAggressive::operator()(), and vl::Renderer::render().

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

Definition at line 1533 of file Shader.hpp.

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

Definition at line 1535 of file Shader.hpp.

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

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

Definition at line 1537 of file Shader.hpp.

Referenced by getClipPlane(), getGLSLProgram(), getLight(), vl::RenderQueueSorterAggressive::operator()(), and vl::Renderer::render().

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

Definition at line 1539 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 std::string& name)
  - eraseUniform(const Uniform* uniform)
  - eraseAllUniforms()
  - getUniform()

Definition at line 1551 of file Shader.hpp.

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

Returns the UniformSet installed.

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

Definition at line 1563 of file Shader.hpp.

Referenced by vl::Renderer::render().

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

Returns the UniformSet installed.

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

Definition at line 1575 of file Shader.hpp.

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

Definition at line 1577 of file Shader.hpp.

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

Definition at line 1579 of file Shader.hpp.

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

Installs a new UniformSet.

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

Definition at line 1591 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 1602 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 1611 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 1620 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 1623 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 1626 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 1629 of file Shader.hpp.

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

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

Definition at line 1632 of file Shader.hpp.

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

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

Used internally.

Definition at line 1635 of file Shader.hpp.

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

## Member Data Documentation

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

Definition at line 1648 of file Shader.hpp.

Referenced by operator=().

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

Definition at line 1649 of file Shader.hpp.

Referenced by operator=().

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

Definition at line 1650 of file Shader.hpp.

Referenced by operator=().

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

Definition at line 1651 of file Shader.hpp.

Referenced by operator=().

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

Definition at line 1652 of file Shader.hpp.

Referenced by operator=().

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

Definition at line 1653 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.05.1142 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 26 2011 22:51:46.
Permission is granted to use this page to write and publish articles regarding Visualization Library.