Tucano
0.1
A library for rapid prototyping with modern OpenGL and GLSL
|
A Shader object represents one GLSL program. More...
#include <shader.hpp>
Public Member Functions | |
void | createProgramID (void) |
Copy Contructor Copies the shader codes and recompiles to generate new program. More... | |
void | createShaders (void) |
Create the necessary shaders. More... | |
Shader (string name, string vertex_shader_path, string fragment_shader_path, string geometry_shader_path="", string tessellation_evaluation_shader_path="", string tessellation_control_shader_path="") | |
Constructor that receives the path for each shader separately. More... | |
Shader (string name, string shader_dir) | |
Constructors that searches a given directory for shaders with given name. More... | |
Shader () | |
Empty constructor. More... | |
void | setShaderName (string name) |
Sets the shader name, very useful for debugging. More... | |
string | getShaderName (void) |
Returns a string with the shader name. More... | |
GLuint | getShaderProgram (void) |
Returns the program identification handle. More... | |
GLuint | getFragmentShader (void) |
Returns a handle to the fragment shader. More... | |
GLuint | getVertexShader (void) |
Returns a handle to the vertex shader. More... | |
GLuint | getGeometryShader (void) |
Returns a handle to the geometry shader. More... | |
GLuint | getTessellationControlShader (void) |
Returns a handle to the tessellation control shader. More... | |
GLuint | getTessellationEvaluationShader (void) |
Returns a handle to the tessellation evaluation shader. More... | |
GLuint | getComputeShader (void) |
void | load (string name, string shader_dir="") |
Loads a shader given a directory and a name. Searches for all shader extensions in directory. More... | |
void | linkProgram (void) |
Link shader program and check for link errors. More... | |
void | initializeTF (int size, const char **varlist, GLenum buffer_mode=GL_INTERLEAVED_ATTRIBS) |
Initializes shader and prepares it to use Transform Feedback. More... | |
void | initializeFromStrings (string in_vertex_code, string in_fragment_code, string in_geometry_code="", string in_tessellation_evaluation_code="", string in_tessellation_control_code="") |
Initializes shader directly from string, no files. More... | |
void | initialize (void) |
Calls all the functions related to the shader initialization, i.e., creates, loads the shaders from the external files and links the shader program. More... | |
void | setVertexShader (string &vertexShaderCode) |
Loads vertex code into shader program. More... | |
void | readVertexCode (void) |
Reads the external file containing the vertex shader and loads it into the shader program. More... | |
void | setTessellationControlShader (string &tessellationControlCode) |
Loads tessellation control code into shader program. More... | |
void | readTessellationControlCode (void) |
Reads the external file containing the tessellation control shader and loads it into the shader program. More... | |
void | setTessellationEvaluationShader (string &tessellationEvaluationCode) |
Loads tessellation evaluation code into shader program. More... | |
void | readTessellationEvaluationCode (void) |
Reads the external file containing the tessellation evaluation shader and loads it into the shader program. More... | |
void | setGeometryShader (string &geometryShaderCode) |
Loads geometry code into shader program. More... | |
void | readGeometryCode (void) |
Reads the external file containing the geometry shader and loads it into the shader program. More... | |
void | setFragmentShader (string &fragmentShaderCode) |
Loads fragment code into shader program. More... | |
void | readFragmentCode (void) |
Reads the external file containing the fragment shader and loads it into the shader program. More... | |
void | setComputeShader (string &computeShaderCode) |
Loads compute code into shader program. More... | |
void | readComputeShaderCode (void) |
Reads the external file containing the compute shader code. More... | |
void | reloadShaders (void) |
Reloads all shaders by reading the files again. More... | |
void | bind (void) |
Enables the shader program for usage. More... | |
void | unbind (void) |
Disables the shader program. More... | |
void | getActiveAttributes (vector< string > &attribs) |
Detaches and deletes the shaders and the shader program. More... | |
GLint | getUniformLocation (const GLchar *name) const |
GLint | getAttributeLocation (const GLchar *name) const |
void | setUniform (GLint location, GLint a, GLint b, GLint c, GLint d) |
Sets an uniform integer 4D vector (ivec4) given a location and the vector values. More... | |
void | setUniform (GLint location, GLint a, GLint b, GLint c) |
Sets an uniform integer 3D vector (ivec3) given a location and the vector values. More... | |
void | setUniform (GLint location, GLint a, GLint b) |
Sets an uniform integer 2D vector (ivec2) given a location and the vector values. More... | |
void | setUniform (GLint location, GLint a) |
Sets an uniform integer given a location and the integer value. More... | |
void | setUniform (const GLchar *name, GLint a, GLint b, GLint c, GLint d) |
Sets an uniform integer 4D vector (ivec4) given its name in the shader and the vector values. More... | |
void | setUniform (const GLchar *name, GLint a, GLint b, GLint c) |
Sets an uniform integer 3D vector (ivec3) given its name in the shader and the vector values. More... | |
void | setUniform (const GLchar *name, GLint a, GLint b) |
Sets an uniform integer 2D vector (ivec2) given its name in the shader and the vector values. More... | |
void | setUniform (const GLchar *name, GLint a) |
Sets an uniform integer given its name in the shader and the integer value. More... | |
void | setUniform (GLint location, const Eigen::Vector4i &vec) |
Sets an uniform integer 4D vector (ivec4) given a location and the vector with values. More... | |
void | setUniform (GLint location, const Eigen::Vector3i &vec) |
Sets an uniform integer 3D vector (ivec3) given a location and the vector with values. More... | |
void | setUniform (GLint location, const Eigen::Vector2i &vec) |
Sets an uniform integer 2D vector (ivec2) given a location and the vector with values. More... | |
void | setUniform (const GLchar *name, const Eigen::Vector4i &vec) |
Sets an uniform integer 4D vector (ivec4) given its name in the shader and the vector with values. More... | |
void | setUniform (const GLchar *name, const Eigen::Vector3i &vec) |
Sets an uniform integer 3D vector (ivec3) given its name in the shader and the vector with values. More... | |
void | setUniform (const GLchar *name, const Eigen::Vector2i &vec) |
Sets an uniform integer 2D vector (ivec2) given its name in the shader and the vector with values. More... | |
void | setUniform (GLint location, GLfloat a, GLfloat b, GLfloat c, GLfloat d) |
Sets an uniform float 4D vector (vec4) given a location and the vector values. More... | |
void | setUniform (GLint location, GLfloat a, GLfloat b, GLfloat c) |
Sets an uniform float 3D vector (vec3) given a location and the vector values. More... | |
void | setUniform (GLint location, GLfloat a, GLfloat b) |
Sets an uniform float 2D vector (vec2) given a location and the vector values. More... | |
void | setUniform (GLint location, GLfloat a) |
Sets an uniform float given a location and the float value. More... | |
void | setUniform (const GLchar *name, GLfloat a, GLfloat b, GLfloat c, GLfloat d) |
Sets an uniform float 4D vector (vec4) given its name in the shader and the vector values. More... | |
void | setUniform (const GLchar *name, GLfloat a, GLfloat b, GLfloat c) |
Sets an uniform float 3D vector (vec3) given its name in the shader and the vector values. More... | |
void | setUniform (const GLchar *name, GLfloat a, GLfloat b) |
Sets an uniform float 2D vector (vec4) given its name in the shader and the vector values. More... | |
void | setUniform (const GLchar *name, GLfloat a) |
Sets an uniform float given its name in the shader and the float value. More... | |
void | setUniform (GLint location, const Eigen::Vector4f &vec) |
Sets an uniform float 4D vector (vec4) given a location and the vector with values. More... | |
void | setUniform (GLint location, const Eigen::Vector3f &vec) |
Sets an uniform float 3D vector (vec3) given a location and the vector with values. More... | |
void | setUniform (GLint location, const Eigen::Vector2f &vec) |
Sets an uniform float 2D vector (vec2) given a location and the vector with values. More... | |
void | setUniform (const GLchar *name, const Eigen::Vector4f &vec) |
Sets an uniform float 4D vector (vec4) given its name in the shader and the vector with values. More... | |
void | setUniform (const GLchar *name, const Eigen::Vector3f &vec) |
Sets an uniform float 3D vector (vec3) given its name in the shader and the vector with values. More... | |
void | setUniform (const GLchar *name, const Eigen::Vector2f &vec) |
Sets an uniform float 2D vector (vec2) given its name in the shader and the vector with values. More... | |
void | setUniform (GLint location, GLdouble a, GLdouble b, GLdouble c, GLdouble d) |
Sets an uniform float 4D vector (vec4) given a location and the vector values as Double. The double values are converted to float. More... | |
void | setUniform (GLint location, GLdouble a, GLdouble b, GLdouble c) |
Sets an uniform float 3D vector (vec3) given a location and the vector values as Double. The double values are converted to float. More... | |
void | setUniform (GLint location, GLdouble a, GLdouble b) |
Sets an uniform float 2D vector (vec2) given a location and the vector values as Double. The double values are converted to float. More... | |
void | setUniform (GLint location, GLdouble a) |
Sets an uniform float given a location and a double value that is converted to float. More... | |
void | setUniform (const GLchar *name, GLdouble a, GLdouble b, GLdouble c, GLdouble d) |
Sets an uniform float 4D vector (vec4) given its name in the shader and the vector values as Double. More... | |
void | setUniform (const GLchar *name, GLdouble a, GLdouble b, GLdouble c) |
Sets an uniform float 3D vector (vec3) given its name in the shader and the vector values as Double. More... | |
void | setUniform (const GLchar *name, GLdouble a, GLdouble b) |
Sets an uniform float 2D vector (vec2) given its name in the shader and the vector values as Double. More... | |
void | setUniform (const GLchar *name, GLdouble a) |
Sets an uniform float given its name in the shader and a double value that is converted to float. More... | |
void | setUniform (GLint location, const Eigen::Vector4d vec) |
Sets an uniform float 4D vector (vec4) given a location and the double vector that is converted to float. More... | |
void | setUniform (GLint location, const Eigen::Vector3d vec) |
Sets an uniform float 3D vector (vec3) given a location and the double vector that is converted to float. More... | |
void | setUniform (GLint location, const Eigen::Vector2d vec) |
Sets an uniform float 2D vector (vec2) given a location and the double vector that is converted to float. More... | |
void | setUniform (const GLchar *name, const Eigen::Vector4d vec) |
Sets an uniform float 4D vector (vec4) given its name in the shader and the double vector that is converted to float. More... | |
void | setUniform (const GLchar *name, const Eigen::Vector3d vec) |
Sets an uniform float 3D vector (vec3) given its name in the shader and the double vector that is converted to float. More... | |
void | setUniform (const GLchar *name, const Eigen::Vector2d vec) |
Sets an uniform float 2D vector (vec2) given its name in the shader and the double vector that is converted to float. More... | |
void | setUniform (GLint location, const GLint *v, GLuint nvalues, GLsizei count=1) |
Sets a integer uniform vector value given its location and an array with the values. More... | |
void | setUniform (GLint location, const GLfloat *v, GLuint nvalues, GLsizei count=1) |
Sets a float uniform vector value given its location and an array with the values. More... | |
void | setUniform (const GLchar *name, const GLint *v, GLuint nvalues, GLsizei count=1) |
Sets a integer uniform vector value given its name in shader and an array with the values. More... | |
void | setUniform (const GLchar *name, const GLfloat *v, GLuint nvalues, GLsizei count=1) |
Sets a float uniform vector value given its name in shader and an array with the values. More... | |
void | setUniform (GLint location, const GLfloat *m, GLuint dim, GLboolean transpose=GL_FALSE, GLsizei count=1) |
Sets a uniform float matrix value given its location. More... | |
void | setUniform (const GLchar *name, const GLfloat *m, GLuint dim, GLboolean transpose=GL_FALSE, GLsizei count=1) |
Sets a uniform float matrix value given its name in shader code. More... | |
void | setUniform (GLint location, const Eigen::Matrix4f &matrix) |
Sets a uniform 4x4 float matrix value given its location and eigen 4x4 matrix. More... | |
void | setUniform (GLint location, const Eigen::Matrix3f &matrix) |
Sets a uniform 3x3 float matrix value given its location and eigen 3x3 matrix. More... | |
void | setUniform (GLint location, const Eigen::Matrix2f &matrix) |
Sets a uniform 2x2 float matrix value given its location and eigen 2x2 matrix. More... | |
void | setUniform (const GLchar *name, const Eigen::Matrix4f &matrix) |
Sets a uniform 4x4 float matrix value given its name in shader and eigen 4x4 matrix. More... | |
void | setUniform (const GLchar *name, const Eigen::Matrix3f &matrix) |
Sets a uniform 3x3 float matrix value given its name in shader and eigen 3x3 matrix. More... | |
void | setUniform (const GLchar *name, const Eigen::Matrix2f &matrix) |
Sets a uniform 2x2 float matrix value given its name in shader and eigen 2x2 matrix. More... | |
void | setUniform (GLint location, const Eigen::Affine3f &affine_matrix) |
Sets a uniform 4x4 float matrix value given its location and eigen 3x3 affine matrix. More... | |
void | setUniform (GLint location, const Eigen::Affine2f &affine_matrix) |
Sets a uniform 3x3 float matrix value given its location and eigen 2x2 affine matrix. More... | |
void | setUniform (const GLchar *name, const Eigen::Affine3f &affine_matrix) |
Sets a uniform 4x4 float matrix value given its name in shader and eigen 3x3 affine matrix. More... | |
void | setUniform (const GLchar *name, const Eigen::Affine2f &affine_matrix) |
Sets a uniform 3x3 float matrix value given its name in shader and eigen 2x2 affine matrix. More... | |
Private Attributes | |
string | shaderName |
Stores an user mainteined identification for the shader. If the shader is created with the autoloader, the name is equal to the filename, without extensions. More... | |
string | vertexShaderPath |
Stores the path to the vertex shader file. More... | |
string | tessellationControlShaderPath |
Stores the path to the tessellation control shader file. More... | |
string | tessellationEvaluationShaderPath |
Stores the path to the tessellation evaluation shader file. More... | |
string | geometryShaderPath |
Stores the path to the geometry shader file. More... | |
string | fragmentShaderPath |
Stores the path to the fragment shader file. More... | |
string | computeShaderPath |
Stores the paths to the compute shaders files. More... | |
string | vertex_code |
Vertex shader code. More... | |
string | fragment_code |
Fragment shader code. More... | |
string | geometry_code |
Geometry shader code. More... | |
string | tessellation_evaluation_code |
Tesselation evaluation code. More... | |
string | tessellation_control_code |
Tesselation control code. More... | |
string | compute_shader_code |
Compute shader code. More... | |
GLuint | computeShader = 0 |
Compute shader identifications. More... | |
GLuint | vertexShader = 0 |
Vertex Shader identification. More... | |
GLuint | tessellationControlShader = 0 |
Tessellation Control Shader identification. More... | |
GLuint | tessellationEvaluationShader = 0 |
Tessellation Evaluation Shader identification. More... | |
GLuint | geometryShader = 0 |
Geometry Shader identification. More... | |
GLuint | fragmentShader = 0 |
Fragment Shader identification. More... | |
GLuint | shaderProgram = 0 |
Shader program identification. More... | |
int | debug_level = 1 |
Debug level for outputing warnings and messages. More... | |
std::shared_ptr< GLuint > | programID_sptr = 0 |
Shared pointer for program ID. More... | |
std::shared_ptr< GLuint > | vertexID_sptr = 0 |
std::shared_ptr< GLuint > | fragID_sptr = 0 |
std::shared_ptr< GLuint > | geomID_sptr = 0 |
std::shared_ptr< GLuint > | tessEvalID_sptr = 0 |
std::shared_ptr< GLuint > | tessContID_sptr = 0 |
std::shared_ptr< GLuint > | computeID_sptr = 0 |
A Shader object represents one GLSL program.
One object can store either the standard rendering pipeline shaders (vertex, geometry, fragment...) or a group of compute shaders. For convenience, it also stores a user defined name, making it easier to access the shaders from within the main program. The shader's name is the same as the shaders filenames, without the extensions.
|
inline |
Constructor that receives the path for each shader separately.
It must receive a vertex and a fragment shader, and optionally can receive a geometry shader.
name | The string to be set as shader identification. User mantained. |
vertex_shader_path | String giving the path to the external file containing the vertex shader. |
fragment_shader_path | String giving the path to the external file containing the fragment shader. |
geometry_shader_path | String giving the path to the external file containing the geometry shader. |
tessellation_evaluation_shader_path | String giving the path to the external file containing the tessellation evaluation shader. |
tessellation_control_shader_path | String giving the path to the external file containing the tessellation control shader. |
|
inline |
Constructors that searches a given directory for shaders with given name.
Receives a directory and a shader name, searches for files with the same name and extesions vert, frag, geom and comp to auto load shaders.
shader_dir | Directory containing shaders. |
name | Shader name, must be the same as the files name without extensions. |
|
inline |
Empty constructor.
|
inline |
Enables the shader program for usage.
After enabling a shader any OpenGL draw call will use it for rendering.
|
inline |
Copy Contructor Copies the shader codes and recompiles to generate new program.
Creates a program ID and sets a shared pointer to monitor it
|
inline |
Create the necessary shaders.
|
inline |
Detaches and deletes the shaders and the shader program.
Generates a list with all active attributes
attribs | Vector of strings to hold attributes names |
|
inline |
Returns the location of an attribute, such as a vertex attribute
name | Name of the attribute variable in the shader. |
|
inline |
|
inline |
Returns a handle to the fragment shader.
|
inline |
Returns a handle to the geometry shader.
|
inline |
Returns a string with the shader name.
If the shader was created with the auto-loader, the name is the same as the shader file name. If not, it's user manteined.
|
inline |
Returns the program identification handle.
|
inline |
Returns a handle to the tessellation control shader.
|
inline |
Returns a handle to the tessellation evaluation shader.
|
inline |
Given the name of a uniform used inside the shader, returns it's location.
name | Name of the uniform variable in shader. |
|
inline |
Returns a handle to the vertex shader.
|
inline |
Calls all the functions related to the shader initialization, i.e., creates, loads the shaders from the external files and links the shader program.
|
inline |
Initializes shader directly from string, no files.
vertex_code | String containing vertex code. |
fragment_code | String containing fragment code. |
geometry_code | String containing geometry code, this is optional. |
tessellation_evaluation_code | String containing tessellation evaluation code, this is optional. |
tessellation_control_code | String containing tessellation control code, this is optional. |
|
inline |
Initializes shader and prepares it to use Transform Feedback.
To use Transform Feedbacks somes parameters must be set before linking the program. These parameters are the number and list of varyings to be set by the TF, and the type of buffer.
size | Number of Transform Feedback varyings. |
varlist | List of varyings for TF. |
buffer_mode | Can be interleaved attributes or separate attributes (default is GL_INTERLEAVED_ATTRIBS). |
|
inline |
Link shader program and check for link errors.
|
inline |
Loads a shader given a directory and a name. Searches for all shader extensions in directory.
Receives a directory and a shader name, searches for files with the same name and extesions vert, frag, geom and comp to auto load shaders.
shader_dir | Directory containing shaders. |
name | Shader name, must be the same as the files name without extensions. |
|
inline |
Reads the external file containing the compute shader code.
|
inline |
Reads the external file containing the fragment shader and loads it into the shader program.
|
inline |
Reads the external file containing the geometry shader and loads it into the shader program.
|
inline |
Reads the external file containing the tessellation control shader and loads it into the shader program.
|
inline |
Reads the external file containing the tessellation evaluation shader and loads it into the shader program.
|
inline |
Reads the external file containing the vertex shader and loads it into the shader program.
|
inline |
Reloads all shaders by reading the files again.
This feature enables runtime editing of the shader codes. After saving the text file after editing, the reload applies changes immediately.
|
inline |
Loads compute code into shader program.
computeShaderCode | String containing compute shader code |
|
inline |
Loads fragment code into shader program.
fragmentShaderCode | String containing fragment code. |
|
inline |
Loads geometry code into shader program.
geometryShaderCode | String containing geometry code. |
|
inline |
Sets the shader name, very useful for debugging.
This constructor receives the path to the compute shader
name | The string as the shader name |
compute_shader_path | String with the path to the external files containing the compute shader. Default destructor. |
name | Shader name |
|
inline |
Loads tessellation control code into shader program.
tessellationControlShaderCode | String containing code |
|
inline |
Loads tessellation evaluation code into shader program.
tessellationEvaluationShaderCode | String containing code |
|
inline |
Sets an uniform integer 4D vector (ivec4) given a location and the vector values.
location | Location handle of uniform variable. |
a | First value of the ivec4. |
b | Second value of the ivec4. |
c | Third value of the ivec4. |
d | Fourth value of the ivec4. |
|
inline |
Sets an uniform integer 3D vector (ivec3) given a location and the vector values.
location | Location handle of uniform variable. |
a | First value of the ivec3. |
b | Second value of the ivec3. |
c | Third value of the ivec3. |
|
inline |
Sets an uniform integer 2D vector (ivec2) given a location and the vector values.
location | Location handle of uniform variable. |
a | First value of the vec2. |
b | Second value of the vec2. |
|
inline |
Sets an uniform integer given a location and the integer value.
location | Location handle of uniform variable. |
a | Integer value. |
|
inline |
Sets an uniform integer 4D vector (ivec4) given its name in the shader and the vector values.
name | Name of uniform variable in the shader code. |
a | First value of the ivec4. |
b | Second value of the ivec4. |
c | Third value of the ivec4. |
d | Fourth value of the ivec4. |
|
inline |
Sets an uniform integer 3D vector (ivec3) given its name in the shader and the vector values.
name | Name of uniform variable in the shader code. |
a | First value of the ivec3. |
b | Second value of the ivec3. |
c | Third value of the ivec3. |
|
inline |
Sets an uniform integer 2D vector (ivec2) given its name in the shader and the vector values.
name | Name of uniform variable in the shader code. |
a | First value of the ivec2. |
b | Second value of the ivec2. |
|
inline |
Sets an uniform integer given its name in the shader and the integer value.
name | Name of uniform variable in the shader code. |
a | Integer value. |
|
inline |
Sets an uniform integer 4D vector (ivec4) given a location and the vector with values.
location | Location handle of uniform variable. |
vec | 4D integer vector. |
|
inline |
Sets an uniform integer 3D vector (ivec3) given a location and the vector with values.
location | Location handle of uniform variable. |
vec | 3D integer vector. |
|
inline |
Sets an uniform integer 2D vector (ivec2) given a location and the vector with values.
location | Location handle of uniform variable. |
vec | 2D integer vector. |
|
inline |
Sets an uniform integer 4D vector (ivec4) given its name in the shader and the vector with values.
name | Name of uniform variable in the shader code. |
vec | 4D integer vector. |
|
inline |
Sets an uniform integer 3D vector (ivec3) given its name in the shader and the vector with values.
name | Name of uniform variable in the shader code. |
vec | 3D integer vector. |
|
inline |
Sets an uniform integer 2D vector (ivec2) given its name in the shader and the vector with values.
name | Name of uniform variable in the shader code. |
vec | 2D integer vector. |
|
inline |
Sets an uniform float 4D vector (vec4) given a location and the vector values.
location | Location handle of uniform variable. |
a | First value of the vec4. |
b | Second value of the vec4. |
c | Third value of the vec4. |
d | Fourth value of the vec4. |
|
inline |
Sets an uniform float 3D vector (vec3) given a location and the vector values.
location | Location handle of uniform variable. |
a | First value of the vec3. |
b | Second value of the vec3. |
c | Third value of the vec3. |
|
inline |
Sets an uniform float 2D vector (vec2) given a location and the vector values.
location | Location handle of uniform variable. |
a | First value of the vec2. |
b | Second value of the vec2. |
|
inline |
Sets an uniform float given a location and the float value.
location | Location handle of uniform variable. |
a | Float value. |
|
inline |
Sets an uniform float 4D vector (vec4) given its name in the shader and the vector values.
name | Name of uniform variable in the shader code. |
a | First value of the vec4. |
b | Second value of the vec4. |
c | Third value of the vec4. |
d | Fourth value of the vec4. |
|
inline |
Sets an uniform float 3D vector (vec3) given its name in the shader and the vector values.
name | Name of uniform variable in the shader code. |
a | First value of the vec3. |
b | Second value of the vec3. |
c | Third value of the vec3. |
|
inline |
Sets an uniform float 2D vector (vec4) given its name in the shader and the vector values.
name | Name of uniform variable in the shader code. |
a | First value of the vec2. |
b | Second value of the vec2. |
|
inline |
Sets an uniform float given its name in the shader and the float value.
name | Name of uniform variable in the shader code. |
a | Float value. |
|
inline |
Sets an uniform float 4D vector (vec4) given a location and the vector with values.
location | Location handle of uniform variable. |
vec | 4D float vector. |
|
inline |
Sets an uniform float 3D vector (vec3) given a location and the vector with values.
location | Location handle of uniform variable. |
vec | 3D float vector. |
|
inline |
Sets an uniform float 2D vector (vec2) given a location and the vector with values.
location | Location handle of uniform variable. |
vec | 2D float vector. |
|
inline |
Sets an uniform float 4D vector (vec4) given its name in the shader and the vector with values.
name | Name of uniform variable in the shader code. |
vec | 4D float vector. |
|
inline |
Sets an uniform float 3D vector (vec3) given its name in the shader and the vector with values.
name | Name of uniform variable in the shader code. |
vec | 3D float vector. |
|
inline |
Sets an uniform float 2D vector (vec2) given its name in the shader and the vector with values.
name | Name of uniform variable in the shader code. |
vec | 2D float vector. |
|
inline |
Sets an uniform float 4D vector (vec4) given a location and the vector values as Double. The double values are converted to float.
location | Location handle of uniform variable. |
a | First value of the vec4. |
b | Second value of the vec4. |
c | Third value of the vec4. |
d | Fourth value of the vec4. |
|
inline |
Sets an uniform float 3D vector (vec3) given a location and the vector values as Double. The double values are converted to float.
location | Location handle of uniform variable. |
a | First value of the vec3. |
b | Second value of the vec3. |
c | Third value of the vec3. |
|
inline |
Sets an uniform float 2D vector (vec2) given a location and the vector values as Double. The double values are converted to float.
location | Location handle of uniform variable. |
a | First value of the vec2. |
b | Second value of the vec2. |
|
inline |
Sets an uniform float given a location and a double value that is converted to float.
location | Location handle of uniform variable. |
a | Double value. |
|
inline |
Sets an uniform float 4D vector (vec4) given its name in the shader and the vector values as Double.
The double values are converted to float.
name | Name of uniform variable in the shader code. |
a | First value of the vec4. |
b | Second value of the vec4. |
c | Third value of the vec4. |
d | Fourth value of the vec4. |
|
inline |
Sets an uniform float 3D vector (vec3) given its name in the shader and the vector values as Double.
The double values are converted to float.
name | Name of uniform variable in the shader code. |
a | First value of the vec3. |
b | Second value of the vec3. |
c | Third value of the vec3. |
|
inline |
Sets an uniform float 2D vector (vec2) given its name in the shader and the vector values as Double.
The double values are converted to float.
name | Name of uniform variable in the shader code. |
a | First value of the vec2. |
b | Second value of the vec2. |
|
inline |
Sets an uniform float given its name in the shader and a double value that is converted to float.
name | Name of uniform variable in the shader code. |
a | Double value. |
|
inline |
Sets an uniform float 4D vector (vec4) given a location and the double vector that is converted to float.
location | Location handle of uniform variable. |
vec | 4D double vector. |
|
inline |
Sets an uniform float 3D vector (vec3) given a location and the double vector that is converted to float.
location | Location handle of uniform variable. |
vec | 3D double vector. |
|
inline |
Sets an uniform float 2D vector (vec2) given a location and the double vector that is converted to float.
location | Location handle of uniform variable. |
vec | 2D double vector. |
|
inline |
Sets an uniform float 4D vector (vec4) given its name in the shader and the double vector that is converted to float.
name | Name of uniform variable in the shader code. |
vec | 4D double vector. |
|
inline |
Sets an uniform float 3D vector (vec3) given its name in the shader and the double vector that is converted to float.
name | Name of uniform variable in the shader code. |
vec | 3D double vector. |
|
inline |
Sets an uniform float 2D vector (vec2) given its name in the shader and the double vector that is converted to float.
name | Name of uniform variable in the shader code. |
vec | 2D double vector. |
|
inline |
Sets a integer uniform vector value given its location and an array with the values.
The vector will be passed as int, ivec2, ivec3, or ivec4 depending on the number of values.
location | Location handle of uniform variable. |
v | Integer array holding the values. |
nvalues | Number of elements per vector. |
count | Number of vectors. |
|
inline |
Sets a float uniform vector value given its location and an array with the values.
The vector will be passed as float, vec2, vec3, or vec4 depending on the number of values.
location | Location handle of uniform variable. |
v | Float array holding the values. |
nvalues | Number of values in the vector v. |
nvalues | Number of elements per vector. |
count | Number of vectors. |
|
inline |
Sets a integer uniform vector value given its name in shader and an array with the values.
The vector will be passed as int, ivec2, ivec3, or ivec4 depending on the number of values.
name | Name of uniform variable in the shader code. |
v | Integer array holding the values. |
nvalues | Number of elements per vector. |
count | Number of vectors. |
|
inline |
Sets a float uniform vector value given its name in shader and an array with the values.
The vector will be passed as float, vec2, vec3, or vec4 depending on the number of values.
name | Name of uniform variable in the shader code. |
v | Float array holding the values. |
nvalues | Number of values in the vector v. |
nvalues | Number of elements per vector. |
count | Number of vectors. |
|
inline |
Sets a uniform float matrix value given its location.
The uniform matrix is assumed to be a mat2, mat3, or mat4 depending on the given dimension.
location | Location handle of uniform variable. |
m | Matrix value with dim^2 values |
dim | Dimension of the matrix m. |
transpose | If transpose is GL_FALSE, each matrix is assumed to be supplied in in column major order, otherwise is in row major order. |
count | Number of elements of the uniform matrix array to be modified. a count of 1 should be used if modifying the value of a single matrix. |
|
inline |
Sets a uniform float matrix value given its name in shader code.
The uniform matrix is assumed to be a mat2, mat3, or mat4 depending on the given dimension.
name | Name of uniform variable in the shader code. |
m | Matrix value with dim^2 values |
dim | Dimension of the matrix m. |
transpose | If transpose is GL_FALSE, each matrix is assumed to be supplied in in column major order, otherwise is in row major order. |
count | Number of elements of the uniform matrix array to be modified. a count of 1 should be used if modifying the value of a single matrix. |
|
inline |
Sets a uniform 4x4 float matrix value given its location and eigen 4x4 matrix.
location | Location handle of uniform variable. |
matrix | 4x4 float matrix. |
|
inline |
Sets a uniform 3x3 float matrix value given its location and eigen 3x3 matrix.
location | Location handle of uniform variable. |
matrix | 3x3 float matrix. |
|
inline |
Sets a uniform 2x2 float matrix value given its location and eigen 2x2 matrix.
location | Location handle of uniform variable. |
matrix | 2x2 float matrix. |
|
inline |
Sets a uniform 4x4 float matrix value given its name in shader and eigen 4x4 matrix.
name | Name of uniform variable in the shader code. |
matrix | 4x4 float matrix. |
|
inline |
Sets a uniform 3x3 float matrix value given its name in shader and eigen 3x3 matrix.
name | Name of uniform variable in the shader code. |
matrix | 3x3 float matrix. |
|
inline |
Sets a uniform 2x2 float matrix value given its name in shader and eigen 2x2 matrix.
name | Name of uniform variable in the shader code. |
matrix | 2x2 float matrix. |
|
inline |
Sets a uniform 4x4 float matrix value given its location and eigen 3x3 affine matrix.
location | Location handle of uniform variable. |
affine_matrix | 3x3 float affine matrix. |
|
inline |
Sets a uniform 3x3 float matrix value given its location and eigen 2x2 affine matrix.
location | Location handle of uniform variable. |
affine_matrix | 2x2 float affine matrix. |
|
inline |
Sets a uniform 4x4 float matrix value given its name in shader and eigen 3x3 affine matrix.
name | Name of uniform variable in the shader code. |
affine_matrix | 3x3 float affine matrix. |
|
inline |
Sets a uniform 3x3 float matrix value given its name in shader and eigen 2x2 affine matrix.
name | Name of uniform variable in the shader code. |
affine_matrix | 2x2 float affine matrix. |
|
inline |
Loads vertex code into shader program.
vertexShaderCode | String containing code |
|
inline |
Disables the shader program.
|
private |
Compute shader code.
|
private |
|
private |
Compute shader identifications.
|
private |
Stores the paths to the compute shaders files.
|
private |
Debug level for outputing warnings and messages.
|
private |
|
private |
Fragment shader code.
|
private |
Fragment Shader identification.
|
private |
Stores the path to the fragment shader file.
|
private |
Geometry shader code.
|
private |
Geometry Shader identification.
|
private |
Stores the path to the geometry shader file.
|
private |
|
private |
Shared pointer for program ID.
|
private |
Stores an user mainteined identification for the shader. If the shader is created with the autoloader, the name is equal to the filename, without extensions.
|
private |
Shader program identification.
|
private |
|
private |
Tesselation control code.
|
private |
Tesselation evaluation code.
|
private |
Tessellation Control Shader identification.
|
private |
Stores the path to the tessellation control shader file.
|
private |
Tessellation Evaluation Shader identification.
|
private |
Stores the path to the tessellation evaluation shader file.
|
private |
|
private |
Vertex shader code.
|
private |
|
private |
Vertex Shader identification.
|
private |
Stores the path to the vertex shader file.