Section: Visualization Toolkit Rendering Classes
.Section vtkOpenGLExtensionManager All OpenGL calls are made through vtkOpenGLExtensionManager.
.Section Supported Basic Shader Types:
Scalar Types uniform float uniform int uniform int -- boolean scalar not yet tested
Vector Types: uniform vec{2|3|4} uniform ivec{2|3|4} uniform bvec{2|3|4} -- boolean vector not yet tested
Matrix Types: uniform mat{2|3|4}
Texture Samplers: sample1D -- Not yet implemented in this cless. sample2D -- Not yet implemented in this class. sample3D -- Not yet implemented in this class. sampler1DShadow -- Not yet implemented in this class. sampler1DShadow -- Not yet implemented in this class. User-Defined structures: uniform struct NOTE: these must be defined and declared outside of the 'main' shader function.
.SECTION Thanks Shader support in VTK includes key contributions by Gary Templet at Sandia National Labs.
To create an instance of class vtkGLSLShader, simply invoke its constructor as follows
obj = vtkGLSLShader
obj
is an instance of the vtkGLSLShader class.
string = obj.GetClassName ()
int = obj.IsA (string name)
vtkGLSLShader = obj.NewInstance ()
vtkGLSLShader = obj.SafeDownCast (vtkObject o)
int = obj.Compile ()
- 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.
int = obj.GetHandle ()
- The Shader needs the id of the ShaderProgram
to obtain uniform variable locations. This is set
by vtkGLSLShaderProgram.
obj.SetProgram (int )
- The Shader needs the id of the ShaderProgram
to obtain uniform variable locations. This is set
by vtkGLSLShaderProgram.
int = obj.GetProgram ()
- The Shader needs the id of the ShaderProgram
to obtain uniform variable locations. This is set
by vtkGLSLShaderProgram.
obj.ReleaseGraphicsResources (vtkWindow )
- Release any graphics resources that are being consumed by this actor.
The parameter window could be used to determine which graphic
resources to release.