13 #ifndef vtkShaderProgram_h
14 #define vtkShaderProgram_h
17 #include "vtkRenderingOpenGL2Module.h"
22 VTK_ABI_NAMESPACE_BEGIN
27 class VertexArrayObject;
48 vtkGetObjectMacro(VertexShader,
vtkShader);
56 vtkGetObjectMacro(FragmentShader,
vtkShader);
64 vtkGetObjectMacro(GeometryShader,
vtkShader);
80 vtkGetMacro(Compiled,
bool);
81 vtkSetMacro(Compiled,
bool);
82 vtkBooleanMacro(Compiled,
bool);
116 void ReleaseGraphicsResources(
vtkWindow* win);
128 bool EnableAttributeArray(
const char*
name);
134 bool DisableAttributeArray(
const char*
name);
151 bool UseAttributeArray(
const char*
name,
int offset,
size_t stride,
int elementType,
152 int elementTupleSize, NormalizeOption normalize);
172 bool SetAttributeArray(
173 const char*
name,
const T& array,
int tupleSize, NormalizeOption normalize);
176 bool SetUniformi(
const char*
name,
int v);
177 bool SetUniformf(
const char*
name,
float v);
178 bool SetUniform2i(
const char*
name,
const int v[2]);
179 bool SetUniform2f(
const char*
name,
const float v[2]);
180 bool SetUniform3f(
const char*
name,
const float v[3]);
181 bool SetUniform3f(
const char*
name,
const double v[3]);
182 bool SetUniform4f(
const char*
name,
const float v[4]);
183 bool SetUniform3uc(
const char*
name,
const unsigned char v[3]);
184 bool SetUniform4uc(
const char*
name,
const unsigned char v[4]);
187 bool SetUniformMatrix3x3(
const char*
name,
float* v);
188 bool SetUniformMatrix4x4(
const char*
name,
float* v);
191 bool SetUniform1iv(
const char*
name,
int count,
const int* f);
192 bool SetUniform1fv(
const char*
name,
int count,
const float* f);
193 bool SetUniform2fv(
const char*
name,
int count,
const float* f);
194 bool SetUniform2fv(
const char*
name,
int count,
const float (*f)[2]);
195 bool SetUniform3fv(
const char* name,
int count,
const float* f);
196 bool SetUniform3fv(
const char* name,
int count,
const float (*f)[3]);
197 bool SetUniform4fv(
const char* name,
int count,
const float* f);
198 bool SetUniform4fv(
const char* name,
int count,
const float (*f)[4]);
199 bool SetUniformMatrix4x4v(
const char* name,
int count,
float* v);
203 vtkSetMacro(NumberOfOutputs,
unsigned int);
216 static bool Substitute(
230 static bool Substitute(
238 bool IsUniformUsed(
const char*);
244 bool IsAttributeUsed(
const char* name);
254 bool operator()(
const char* a,
const char* b)
const {
return strcmp(a, b) < 0; }
275 vtkSetFilePathMacro(FileNamePrefixForDebugging);
276 vtkGetFilePathMacro(FileNamePrefixForDebugging);
297 int FindUniform(
const char* name);
298 int FindAttributeArray(
const char* name);
318 bool AttachShader(
const vtkShader* shader);
325 bool DetachShader(
const vtkShader* shader);
330 virtual int CompileShader();
358 bool SetAttributeArrayInternal(
385 friend class VertexArrayObject;
391 char* FileNamePrefixForDebugging;
394 VTK_ABI_NAMESPACE_END
std::map< const char *, int, cmp_str > UniformLocs
int GetHandle() const
Get the handle of the shader program.
abstract base class for most VTK objects
represent and manipulate 4x4 transformation matrices
std::map< const char *, int, cmp_str > AttributeLocs
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTransformFeedback * TransformFeedback
vtkTypeUInt32 vtkMTimeType
unsigned int NumberOfOutputs
manage Shader Programs within a context
bool isBound() const
Check if the program is currently bound, or not.
The values range across the limits of the numeric type.
bool operator()(const char *a, const char *b) const
void SetMD5Hash(const std::string &hash)
window superclass for vtkRenderWindow
a simple class to control print indentation
vtkShader * GeometryShader
vtkShader * FragmentShader
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
NormalizeOption
Options for attribute normalization.
std::string GetMD5Hash() const
Set/Get the md5 hash of this program.
Vertex or Fragment shader, combined into a ShaderProgram.
std::map< int, vtkMTimeType > UniformGroupMTimes
std::string GetError() const
Get the error message (empty if none) for the shader program.
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
UniformGroups
Set/Get times that can be used to track when a set of uniforms was last updated.
The ShaderProgram uses one or more Shader objects.