Go to the documentation of this file.
21 #ifndef vtkShaderProgram_h
22 #define vtkShaderProgram_h
24 #include "vtkRenderingOpenGL2Module.h"
34 class VertexArrayObject;
87 vtkGetMacro(Compiled,
bool);
160 int elementType,
int elementTupleSize,
244 return strcmp(a, b) < 0;
307 int type,
int tupleSize,
332 friend class VertexArrayObject;
335 int FindAttributeArray(
const char *
name);
336 int FindUniform(
const char *
name);
bool SetUniform2fv(const char *name, const int count, const float(*f)[2])
virtual int CompileShader()
Compile this shader program and attached shaders.
void Release()
Releases the shader program from the current context.
std::string GetMD5Hash() const
Set/Get the md5 hash of this program.
bool SetUniformMatrix4x4(const char *name, float *v)
NormalizeOption
Options for attribute normalization.
bool Link()
Attempt to link the shader program.
bool SetUniform4f(const char *name, const float v[4])
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
bool SetAttributeArray(const char *name, const T &array, int tupleSize, NormalizeOption normalize)
Upload the supplied array of tightly packed values to the named attribute.
vtkShader * FragmentShader
std::string GetError() const
Get the error message (empty if none) for the shader program.
abstract base class for most VTK objects
void SetTransformFeedback(vtkTransformFeedback *tfc)
bool SetUniformf(const char *name, float v)
static vtkShaderProgram * New()
bool UseAttributeArray(const char *name, int offset, size_t stride, int elementType, int elementTupleSize, NormalizeOption normalize)
Use the named attribute array with the bound BufferObject.
std::map< const char *, int, cmp_str > AttributeLocs
represent and manipulate 3x3 transformation matrices
bool IsAttributeUsed(const char *name)
Return true if the compiled and linked shader has an attribute matching name.
bool Bind()
Bind the program in order to use it.
bool DisableAttributeArray(const char *name)
Disable the named attribute array.
window superclass for vtkRenderWindow
bool SetAttributeArrayInternal(const char *name, void *buffer, int type, int tupleSize, NormalizeOption normalize)
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
bool SetUniform1fv(const char *name, const int count, const float *f)
bool DetachShader(const vtkShader *shader)
Detach the supplied shader from this program.
void SetGeometryShader(vtkShader *)
bool SetUniform2i(const char *name, const int v[2])
bool SetUniformMatrix(const char *name, vtkMatrix4x4 *v)
The ShaderProgram uses one or more Shader objects.
void SetVertexShader(vtkShader *)
a simple class to control print indentation
represent and manipulate 4x4 transformation matrices
@ Normalize
The values range across the limits of the numeric type.
bool SetUniformi(const char *name, int v)
Set the name uniform value to int v.
vtkTransformFeedback * TransformFeedback
bool isBound() const
Check if the program is currently bound, or not.
Vertex or Fragment shader, combined into a ShaderProgram.
bool SetUniform4fv(const char *name, const int count, const float(*f)[4])
bool SetUniform3uc(const char *name, const unsigned char v[3])
bool IsUniformUsed(const char *)
methods to inquire as to what uniforms/attributes are used by this shader.
static bool Substitute(std::string &source, const std::string &search, const std::string &replace, bool all=true)
perform in place string substitutions, indicate if a substitution was done this is useful for buildin...
manage Shader Programs within a context
bool SetUniformMatrix(const char *name, vtkMatrix3x3 *v)
int GetHandle() const
Get the handle of the shader program.
bool operator()(const char *a, const char *b) const
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
unsigned int NumberOfOutputs
bool SetUniformMatrix4x4v(const char *name, const int count, float *v)
void SetFragmentShader(vtkShader *)
bool EnableAttributeArray(const char *name)
Enable the named attribute array.
void SetMD5Hash(const std::string &hash)
bool SetUniform2f(const char *name, const float v[2])
bool SetUniform3fv(const char *name, const int count, const float(*f)[3])
std::map< const char *, int, cmp_str > UniformLocs
bool SetUniformMatrix3x3(const char *name, float *v)
std::string replace(std::string source, const std::string &search, const std::string &replace, bool all)
vtkShader * GeometryShader
bool AttachShader(const vtkShader *shader)
Attach the supplied shader to this program.
bool SetUniform4uc(const char *name, const unsigned char v[4])
bool SetUniform3f(const char *name, const float v[3])
void ReleaseGraphicsResources(vtkWindow *win)
release any graphics resources this class is using.
bool SetUniform1iv(const char *name, const int count, const int *f)
Set the name uniform array to f with count elements.