|
Developer Documentation
|
#include <ACG/ShaderUtils/GLSLShader.hh>
Public Member Functions | |
| Program () | |
| Creates a new GLSL program object. | |
| virtual | ~Program () |
| Deletes the GLSL program object and frees the linked shader objects. | |
Compilation/Linking | |
| void | attach (PtrConstShader _shader) |
| Attaches a shader object to the program object. | |
| void | detach (PtrConstShader _shader) |
| Detaches a shader object from the program object. | |
| void | link () |
| Links the shader objects to the program. | |
Localizations | |
| int | getAttributeLocation (const char *_name) |
| Get location of the specified attribute. | |
| int | getUniformLocation (const char *_name) |
| Get location of the specified uniform. | |
| void | bindAttributeLocation (unsigned int _index, const char *_name) |
| Bind attribute to name. | |
Uniform setters | |
| void | setUniform (const char *_name, GLint _value) |
| Set int uniform to specified value. | |
| void | setUniform (const char *_name, GLfloat _value) |
| Set float uniform to specified value. | |
| void | setUniform (const char *_name, const ACG::Vec2f &_value) |
| Set Vec2f uniform to specified value. | |
| void | setUniform (const char *_name, const ACG::Vec3f &_value) |
| Set int uniform to specified value. | |
| void | setUniform (const char *_name, const ACG::Vec4f &_value) |
| Set int uniform to specified value. | |
| void | setUniform (const char *_name, const ACG::GLMatrixf &_value, bool _transposed=false) |
| Set 4x4fMatrix uniform to specified value. | |
| void | setUniformMat3 (const char *_name, const ACG::GLMatrixf &_value, bool _transposed=false) |
| Set 3x3fMatrix uniform to specified value. | |
| void | setUniform (const char *_name, GLint *_values, int _count) |
| Set int array uniform to specified values. | |
| void | setUniform (const char *_name, GLfloat *_values, int _count) |
| Set float array uniform to specified values. | |
| void | setUniform (const char *_name, int _index, bool _value) |
| Set an entry of a bool uniform array. | |
| void | setUniform (const char *_name, int _index, int _value) |
| Set an entry of a int uniform array. | |
| void | setUniform (const char *_name, int _index, float _value) |
| Set an entry of a float uniform array. | |
Geometry shader parameters | |
| void | setGeometryInputType (GLint _type) |
| Set Type of Geometry. | |
| void | setGeometryOutputType (GLint _type) |
| Set output type of geometry. | |
| void | setGeometryVertexCount (GLint _numVerticesOut) |
| Sets the maximum vertex output of the geometry shader. | |
Enable/disable functions | |
| void | use () |
| Enables the program object for using. | |
| void | disable () |
| Resets to standard rendering pipeline. | |
| bool | isActive () |
| Returns if the program object is currently active. | |
Private Attributes | |
| std::list< PtrConstShader > | m_linkedShaders |
| GLint | m_programId |
GLSL program class.
A GLSL program links together the vertex and fragment shaders.
Definition at line 138 of file GLSLShader.hh.
| void GLSL::Program::bindAttributeLocation | ( | unsigned int | _index, |
| const char * | _name | ||
| ) |
Bind attribute to name.
| _index | Index of the attribute to be bound |
| _name | Name of the attribute |
Definition at line 454 of file GLSLShader.cc.
| int GLSL::Program::getAttributeLocation | ( | const char * | _name | ) |
Get location of the specified attribute.
| _name | Name of the attribute |
Definition at line 464 of file GLSLShader.cc.
| int GLSL::Program::getUniformLocation | ( | const char * | _name | ) |
Get location of the specified uniform.
| _name | Name of the uniform |
Definition at line 475 of file GLSLShader.cc.
| void GLSL::Program::setGeometryInputType | ( | GLint | _type | ) |
Set Type of Geometry.
valid input types: GL_POINTS, GL_LINES, GL_LINES_ADJACENCY_EXT, GL_TRIANGLES, GL_TRIANGLES_ADJACENCY_EXT
| _type | Geometry type |
Definition at line 487 of file GLSLShader.cc.
| void GLSL::Program::setGeometryOutputType | ( | GLint | _type | ) |
Set output type of geometry.
valid output types: GL_POINTS, GL_LINE_STRIP, GL_TRIANGLE_STRIP
| _type | Output geometry type |
Definition at line 497 of file GLSLShader.cc.
| void GLSL::Program::setGeometryVertexCount | ( | GLint | _numVerticesOut | ) |
Sets the maximum vertex output of the geometry shader.
Query GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT to get the gpu limitation
| _numVerticesOut | Maximal number of vertices |
Definition at line 507 of file GLSLShader.cc.
| void GLSL::Program::setUniform | ( | const char * | _name, |
| GLint | _value | ||
| ) |
Set int uniform to specified value.
| _name | Name of the uniform |
| _value | New value of the uniform |
Definition at line 290 of file GLSLShader.cc.
| void GLSL::Program::setUniform | ( | const char * | _name, |
| GLfloat | _value | ||
| ) |
Set float uniform to specified value.
| _name | Name of the uniform |
| _value | New value of the uniform |
Definition at line 303 of file GLSLShader.cc.
| void GLSL::Program::setUniform | ( | const char * | _name, |
| const ACG::Vec2f & | _value | ||
| ) |
Set Vec2f uniform to specified value.
Set Vec4f uniform to specified value.
Set Vec3f uniform to specified value.
| _name | Name of the uniform |
| _value | New value of the uniform |
Definition at line 316 of file GLSLShader.cc.
| void GLSL::Program::setUniform | ( | const char * | _name, |
| const ACG::Vec3f & | _value | ||
| ) |
Set int uniform to specified value.
| _name | Name of the uniform |
| _value | New value of the uniform |
| void GLSL::Program::setUniform | ( | const char * | _name, |
| const ACG::Vec4f & | _value | ||
| ) |
Set int uniform to specified value.
| _name | Name of the uniform |
| _value | New value of the uniform |
| void GLSL::Program::setUniform | ( | const char * | _name, |
| const ACG::GLMatrixf & | _value, | ||
| bool | _transposed = false |
||
| ) |
Set 4x4fMatrix uniform to specified value.
| _name | Name of the uniform |
| _value | Matrix to be set |
| _transposed | Is the matrix transposed? |
Definition at line 421 of file GLSLShader.cc.
| void GLSL::Program::setUniform | ( | const char * | _name, |
| GLint * | _values, | ||
| int | _count | ||
| ) |
Set int array uniform to specified values.
| _name | Name of the uniform to be set |
| _values | Pointer to an array with the new values |
| _count | Number of values in the given array |
Definition at line 356 of file GLSLShader.cc.
| void GLSL::Program::setUniform | ( | const char * | _name, |
| GLfloat * | _values, | ||
| int | _count | ||
| ) |
Set float array uniform to specified values.
| _name | Name of the uniform to be set |
| _values | Pointer to an array with the new values |
| _count | Number of values in the given array |
Definition at line 370 of file GLSLShader.cc.
| void GLSL::Program::setUniform | ( | const char * | _name, |
| int | _index, | ||
| bool | _value | ||
| ) |
Set an entry of a bool uniform array.
| _name | Name of the uniform to be set |
| _index | Entry in the array |
| _value | New value of the entry |
Definition at line 384 of file GLSLShader.cc.
| void GLSL::Program::setUniform | ( | const char * | _name, |
| int | _index, | ||
| int | _value | ||
| ) |
Set an entry of a int uniform array.
| _name | Name of the uniform to be set |
| _index | Entry in the array |
| _value | New value of the entry |
Definition at line 396 of file GLSLShader.cc.
| void GLSL::Program::setUniform | ( | const char * | _name, |
| int | _index, | ||
| float | _value | ||
| ) |
Set an entry of a float uniform array.
| _name | Name of the uniform to be set |
| _index | Entry in the array |
| _value | New value of the entry |
Definition at line 408 of file GLSLShader.cc.
| void GLSL::Program::setUniformMat3 | ( | const char * | _name, |
| const ACG::GLMatrixf & | _value, | ||
| bool | _transposed = false |
||
| ) |
Set 3x3fMatrix uniform to specified value.
| _name | Name of the uniform |
| _value | Matrix to be set |
| _transposed | Is the matrix transposed? |
Definition at line 435 of file GLSLShader.cc.