24 #ifndef vtkShaderProgram_h 25 #define vtkShaderProgram_h 27 #include "vtkRenderingOpenGL2Module.h" 37 class VertexArrayObject;
58 vtkGetObjectMacro(VertexShader,
vtkShader);
66 vtkGetObjectMacro(FragmentShader,
vtkShader);
74 vtkGetObjectMacro(GeometryShader,
vtkShader);
90 vtkGetMacro(Compiled,
bool);
127 void ReleaseGraphicsResources(
vtkWindow *win);
139 bool EnableAttributeArray(
const char *
name);
145 bool DisableAttributeArray(
const char *
name);
162 bool UseAttributeArray(
const char *
name,
int offset,
size_t stride,
163 int elementType,
int elementTupleSize,
164 NormalizeOption normalize);
184 bool SetAttributeArray(
const char *
name,
const T &array,
185 int tupleSize, NormalizeOption normalize);
188 bool SetUniformi(
const char *
name,
int v);
189 bool SetUniformf(
const char *
name,
float v);
190 bool SetUniform2i(
const char *
name,
const int v[2]);
191 bool SetUniform2f(
const char *
name,
const float v[2]);
192 bool SetUniform3f(
const char *
name,
const float v[3]);
193 bool SetUniform3f(
const char *
name,
const double v[3]);
194 bool SetUniform4f(
const char *
name,
const float v[4]);
195 bool SetUniform3uc(
const char *
name,
const unsigned char v[3]);
196 bool SetUniform4uc(
const char *
name,
const unsigned char v[4]);
199 bool SetUniformMatrix3x3(
const char *
name,
float *v);
200 bool SetUniformMatrix4x4(
const char *
name,
float *v);
203 bool SetUniform1iv(
const char *
name,
const int count,
const int *f);
204 bool SetUniform1fv(
const char *
name,
const int count,
const float *f);
205 bool SetUniform2fv(
const char *
name,
const int count,
const float (*f)[2]);
206 bool SetUniform3fv(
const char *
name,
const int count,
const float (*f)[3]);
207 bool SetUniform4fv(
const char *
name,
const int count,
const float (*f)[4]);
208 bool SetUniformMatrix4x4v(
const char *
name,
const int count,
float *v);
225 static bool Substitute(
242 static bool Substitute(
253 bool IsUniformUsed(
const char *);
259 bool IsAttributeUsed(
const char *
name);
271 return strcmp(a, b) < 0;
293 vtkSetStringMacro(FileNamePrefixForDebugging);
315 bool AttachShader(
const vtkShader *shader);
322 bool DetachShader(
const vtkShader *shader);
327 virtual int CompileShader();
355 bool SetAttributeArrayInternal(
const char *
name,
void *buffer,
356 int type,
int tupleSize,
381 friend class VertexArrayObject;
384 int FindAttributeArray(
const char *
name);
385 int FindUniform(
const char *
name);
390 char* FileNamePrefixForDebugging;
abstract base class for most VTK objects
represent and manipulate 4x4 transformation matrices
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTransformFeedback * TransformFeedback
bool isBound() const
Check if the program is currently bound, or not.
unsigned int NumberOfOutputs
manage Shader Programs within a context
The values range across the limits of the numeric type.
std::map< const char *, int, cmp_str > UniformLocs
int GetHandle() const
Get the handle of the shader program.
void SetMD5Hash(const std::string &hash)
window superclass for vtkRenderWindow
a simple class to control print indentation
vtkShader * GeometryShader
bool operator()(const char *a, const char *b) const
std::string GetMD5Hash() const
Set/Get the md5 hash of this program.
vtkShader * FragmentShader
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
std::string GetError() const
Get the error message (empty if none) for the shader program.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
NormalizeOption
Options for attribute normalization.
boost::graph_traits< vtkGraph *>::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Vertex or Fragment shader, combined into a ShaderProgram.
std::map< const char *, int, cmp_str > AttributeLocs
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
represent and manipulate 3x3 transformation matrices
The ShaderProgram uses one or more Shader objects.