#include <vtkCgShader.h>
vtkCgShader is the only class that interfaces directly with the Cg libraries. Once is has a valid shader described by a vtkXMLDataElement it will create, compile, install, and initialize the parameters of a Cg hardware shader.
Definition at line 106 of file vtkCgShader.h.
virtual void | PassShaderVariables (vtkActor *actor, vtkRenderer *ren) |
vtkCgShader () | |
~vtkCgShader () | |
Public Types | |
typedef vtkShader | Superclass |
Public Member Functions | |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
virtual int | Compile () |
virtual void | Bind () |
virtual void | Unbind () |
void | ReportError () |
void | ReleaseGraphicsResources (vtkWindow *) |
Static Public Member Functions | |
static vtkCgShader * | New () |
static int | IsTypeOf (const char *type) |
static vtkCgShader * | SafeDownCast (vtkObject *o) |
Protected Member Functions | |
virtual void | SetSamplerParameter (const char *name, vtkTexture *texture, int) |
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) |
Friends | |
class | vtkCgShaderDeviceAdapter |
typedef vtkShader vtkCgShader::Superclass |
vtkCgShader::vtkCgShader | ( | ) | [protected] |
Called to pass VTK actor/property/light values and other Shader variables over to the shader. This is called by the ShaderProgram during each render. We override this method for Cg shaders, since for Cg shaders, we need to ensure that the actor transformations are pushed before state matrix uniform variables are bound.
vtkCgShader::~vtkCgShader | ( | ) | [protected] |
Called to pass VTK actor/property/light values and other Shader variables over to the shader. This is called by the ShaderProgram during each render. We override this method for Cg shaders, since for Cg shaders, we need to ensure that the actor transformations are pushed before state matrix uniform variables are bound.
static vtkCgShader* vtkCgShader::New | ( | ) | [static] |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkObject.
virtual const char* vtkCgShader::GetClassName | ( | ) | [virtual] |
Reimplemented from vtkShader.
static int vtkCgShader::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 vtkCgShader::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 vtkCgShader* vtkCgShader::SafeDownCast | ( | vtkObject * | o | ) | [static] |
Reimplemented from vtkShader.
void vtkCgShader::PrintSelf | ( | ostream & | os, | |
vtkIndent | indent | |||
) | [virtual] |
virtual int vtkCgShader::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.
virtual void vtkCgShader::Bind | ( | ) | [virtual] |
In this method the shader can enable/bind itself. This is applicable only to Cg, since in GLSL, individual shaders in a program can't be enabled/bound.
Reimplemented from vtkShader.
virtual void vtkCgShader::Unbind | ( | ) | [virtual] |
void vtkCgShader::ReportError | ( | ) |
Internal method don't call directly. Called by Cg erro callback to report Cg errors.
void vtkCgShader::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.
virtual void vtkCgShader::PassShaderVariables | ( | vtkActor * | actor, | |
vtkRenderer * | ren | |||
) | [virtual] |
Called to pass VTK actor/property/light values and other Shader variables over to the shader. This is called by the ShaderProgram during each render. We override this method for Cg shaders, since for Cg shaders, we need to ensure that the actor transformations are pushed before state matrix uniform variables are bound.
Reimplemented from vtkShader.
virtual void vtkCgShader::SetUniformParameter | ( | const char * | name, | |
int | numValues, | |||
const int * | value | |||
) | [protected, virtual] |
Equivalent to cgGLSetParameter and glUniform.
Implements vtkShader.
virtual void vtkCgShader::SetUniformParameter | ( | const char * | name, | |
int | numValues, | |||
const float * | value | |||
) | [protected, virtual] |
Equivalent to cgGLSetParameter and glUniform.
Implements vtkShader.
virtual void vtkCgShader::SetUniformParameter | ( | const char * | name, | |
int | numValues, | |||
const double * | value | |||
) | [protected, virtual] |
Equivalent to cgGLSetParameter and glUniform.
Implements vtkShader.
virtual void vtkCgShader::SetMatrixParameter | ( | const char * | name, | |
int | numValues, | |||
int | order, | |||
const float * | value | |||
) | [protected, virtual] |
Equivalent to cgGLSetMatrixParameterfc and glUniformMatrix.
Implements vtkShader.
virtual void vtkCgShader::SetMatrixParameter | ( | const char * | name, | |
int | numValues, | |||
int | order, | |||
const double * | value | |||
) | [protected, virtual] |
Equivalent to cgGLSetMatrixParameterfc and glUniformMatrix.
Implements vtkShader.
virtual void vtkCgShader::SetMatrixParameter | ( | const char * | name, | |
const char * | state_matix_type, | |||
const char * | transform_type | |||
) | [protected, virtual] |
Equivalent to cgGLSetMatrixParameterfc and glUniformMatrix.
Implements vtkShader.
virtual void vtkCgShader::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.
friend class vtkCgShaderDeviceAdapter [friend] |
Definition at line 172 of file vtkCgShader.h.