VTK
|
GLSL Shader. More...
#include <vtkGLSLShader.h>
Public Types | |
typedef vtkShader | Superclass |
Public Member Functions | |
virtual int | IsA (const char *type) |
vtkGLSLShader * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) |
virtual int | Compile () |
unsigned int | GetHandle () |
virtual void | SetProgram (unsigned int) |
virtual unsigned int | GetProgram () |
Static Public Member Functions | |
static vtkGLSLShader * | New () |
static int | IsTypeOf (const char *type) |
static vtkGLSLShader * | SafeDownCast (vtkObjectBase *o) |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
int | IsShader () |
int | IsCompiled () |
void | LoadShader () |
virtual void | SetSamplerParameter (const char *name, vtkTexture *texture, int textureIndex) |
virtual void | SetUniformParameter (const char *name, int numValues, const int *value) |
virtual void | SetUniformParameter (const char *name, int numValues, const float *value) |
virtual void | SetUniformParameter (const char *name, int numValues, const double *value) |
virtual void | SetMatrixParameter (const char *name, int numValues, int order, const float *value) |
virtual void | SetMatrixParameter (const char *name, int numValues, int order, const double *value) |
virtual void | SetMatrixParameter (const char *name, const char *state_matix_type, const char *transform_type) |
Protected Attributes | |
unsigned int | Program |
unsigned int | Shader |
virtual void | ReleaseGraphicsResources (vtkWindow *) |
vtkGLSLShader () | |
virtual | ~vtkGLSLShader () |
GLSL Shader.
vtkGLSLShader is a concrete class that creates and compiles hardware shaders written in the OpenGL Shadering Language (GLSL, OpenGL2.0). While step linking a vertex and a fragment shader is performed by vtkGLSLShaderProgram, all shader parameters are initialized in this class.
Definition at line 88 of file vtkGLSLShader.h.
typedef vtkShader vtkGLSLShader::Superclass |
Reimplemented from vtkShader.
Definition at line 92 of file vtkGLSLShader.h.
vtkGLSLShader::vtkGLSLShader | ( | ) | [protected] |
Release any graphics resources that are being consumed by this actor. The parameter window could be used to determine which graphic resources to release.
virtual vtkGLSLShader::~vtkGLSLShader | ( | ) | [protected, virtual] |
Release any graphics resources that are being consumed by this actor. The parameter window could be used to determine which graphic resources to release.
static vtkGLSLShader* vtkGLSLShader::New | ( | ) | [static] |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkObject.
static int vtkGLSLShader::IsTypeOf | ( | const char * | name | ) | [static] |
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkShader.
virtual int vtkGLSLShader::IsA | ( | const char * | name | ) | [virtual] |
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkShader.
static vtkGLSLShader* vtkGLSLShader::SafeDownCast | ( | vtkObjectBase * | o | ) | [static] |
Reimplemented from vtkShader.
virtual vtkObjectBase* vtkGLSLShader::NewInstanceInternal | ( | ) | const [protected, virtual] |
Reimplemented from vtkShader.
vtkGLSLShader* vtkGLSLShader::NewInstance | ( | ) | const |
Reimplemented from vtkShader.
void vtkGLSLShader::PrintSelf | ( | ostream & | os, |
vtkIndent | indent | ||
) | [virtual] |
virtual int vtkGLSLShader::Compile | ( | ) | [virtual] |
Called to compile the shader code. The subclasses must only compile the code in this method. Returns if the compile was successful. Subclasses should compile the code only if it was not already compiled.
Implements vtkShader.
unsigned int vtkGLSLShader::GetHandle | ( | ) | [inline] |
The vtkGLSLShaderProgram needs the shader handle for attaching.
Definition at line 102 of file vtkGLSLShader.h.
virtual void vtkGLSLShader::SetProgram | ( | unsigned | int | ) | [virtual] |
The Shader needs the id of the ShaderProgram to obtain uniform variable locations. This is set by vtkGLSLShaderProgram.
virtual unsigned int vtkGLSLShader::GetProgram | ( | ) | [virtual] |
The Shader needs the id of the ShaderProgram to obtain uniform variable locations. This is set by vtkGLSLShaderProgram.
virtual void vtkGLSLShader::ReleaseGraphicsResources | ( | vtkWindow * | ) | [virtual] |
Release any graphics resources that are being consumed by this actor. The parameter window could be used to determine which graphic resources to release.
Reimplemented from vtkShader.
int vtkGLSLShader::IsShader | ( | ) | [protected] |
int vtkGLSLShader::IsCompiled | ( | ) | [protected] |
void vtkGLSLShader::LoadShader | ( | ) | [protected] |
Create an empty Shader context.
virtual void vtkGLSLShader::SetUniformParameter | ( | const char * | name, |
int | numValues, | ||
const int * | value | ||
) | [protected, virtual] |
Equivalent to cgGLSetParameter and glUniform.
Implements vtkShader.
virtual void vtkGLSLShader::SetUniformParameter | ( | const char * | name, |
int | numValues, | ||
const float * | value | ||
) | [protected, virtual] |
Equivalent to cgGLSetParameter and glUniform.
Implements vtkShader.
virtual void vtkGLSLShader::SetUniformParameter | ( | const char * | name, |
int | numValues, | ||
const double * | value | ||
) | [protected, virtual] |
Equivalent to cgGLSetParameter and glUniform.
Implements vtkShader.
virtual void vtkGLSLShader::SetMatrixParameter | ( | const char * | name, |
int | numValues, | ||
int | order, | ||
const float * | value | ||
) | [protected, virtual] |
Equivalent to cgGLSetMatrixParameterfc and glUniformMatrix.
Implements vtkShader.
virtual void vtkGLSLShader::SetMatrixParameter | ( | const char * | name, |
int | numValues, | ||
int | order, | ||
const double * | value | ||
) | [protected, virtual] |
Equivalent to cgGLSetMatrixParameterfc and glUniformMatrix.
Implements vtkShader.
virtual void vtkGLSLShader::SetMatrixParameter | ( | const char * | name, |
const char * | state_matix_type, | ||
const char * | transform_type | ||
) | [protected, virtual] |
Equivalent to cgGLSetMatrixParameterfc and glUniformMatrix.
Implements vtkShader.
virtual void vtkGLSLShader::SetSamplerParameter | ( | const char * | name, |
vtkTexture * | texture, | ||
int | textureIndex | ||
) | [protected, virtual] |
Establishes the given texture as the uniform sampler to perform lookups on. The textureIndex argument corresponds to the indices of the textures in a vtkProperty. Subclass may have to cast the texture to vtkOpenGLTexture to obtain the GLuint for texture this texture. Subclasses must override these and perform GLSL or Cg calls.
Implements vtkShader.
unsigned int vtkGLSLShader::Program [protected] |
Definition at line 122 of file vtkGLSLShader.h.
unsigned int vtkGLSLShader::Shader [protected] |
Definition at line 123 of file vtkGLSLShader.h.