GlobeEngine
|
#include <Shader.h>
Public Types | |
enum | ShaderType { VERTEX_FRAGMENT = 0, VERTEX_FRAGMENT_GEOMETRY = 1, VERTEX_FRAGMENT_GEOMETRY_TESSELATION = 2, COMPUTE } |
Public Member Functions | |
Shader () | |
~Shader () | |
Shader (const std::shared_ptr< Shader > copy) | |
void | clear () |
void | load (std::string _inputPath, ge::Shader::ShaderType _type, std::string _genericShaderPath="") |
void | load (std::string _repopath, std::string _relPath, ge::Shader::ShaderType _type, std::string _genericShaderPath="") |
void | loadFromSourceVertFrag (std::string _vertSource, std::string _fragSource) |
GLuint | getVertexArrayAttributeCount () const |
GLuint | getHandle () |
void | recompile (ShaderProgram::ReloadType _type=ShaderProgram::ReloadType::FROMFILE) |
void | bind () const |
void | unbind () const |
void | dispatchCompute (GLuint _numGroupsX, GLuint _numGroupsY, GLuint _numGroupsZ) const |
void | dispatchCompute (vmml::Vector3ui _numGroups) const |
void | setUniform1d (std::string _name, double _value) const |
void | setUniformVector2d (std::string _name, vmml::Vector2d _value) const |
void | setUniformVector3d (std::string _name, vmml::Vector3d _value) const |
void | setUniformVector4d (std::string _name, vmml::Vector4d _value) const |
void | setUniformMatrix3d (std::string _name, vmml::Matrix3d _value, bool _transpose=false) const |
void | setUniformMatrix4d (std::string _name, vmml::Matrix4d _value, bool _transpose=false) const |
void | setUniformBlockBinding (std::string _ublockName, GLuint _ublockBinding) |
void | setUniformBlockBinding (GLuint _ublockIdx, GLuint _ublockBinding) |
GLuint | getUniformBlockIndex (std::string _input) |
void | setUniform1i (std::string _name, int _value) const |
void | setUniform1f (std::string _name, float _value) const |
void | setUniformVector2i (std::string _name, vmml::Vector2i _value) const |
void | setUniformVector2f (std::string _name, vmml::Vector2f _value) const |
void | setUniformVector3f (std::string _name, vmml::Vector3f _value) const |
void | setUniformVector4f (std::string _name, vmml::Vector4f _value) const |
void | setUniformVector4f (std::string _name, const float *_values) const |
void | setUniformMatrix3f (std::string _name, vmml::Matrix3f _value, bool _transpose=false) const |
void | setUniformMatrix4f (std::string _name, vmml::Matrix4f _value, bool _transpose=false) const |
void | setUniformArrayf (std::string _name, int _count, const GLfloat *_values) const |
void | setDefine1i (std::string _in, int _value) |
void | setDefinesToZeroWithoutRecompile () |
Static Public Member Functions | |
static void | printComputeCapabilities () |
ge::Shader::Shader | ( | ) |
ge::Shader::~Shader | ( | ) |
|
inline |
void ge::Shader::bind | ( | ) | const |
void ge::Shader::clear | ( | ) |
void ge::Shader::dispatchCompute | ( | GLuint | _numGroupsX, |
GLuint | _numGroupsY, | ||
GLuint | _numGroupsZ | ||
) | const |
dispatches a compute command: : the number of groups in X direction. : the number of groups in Y direction. : the number of groups in Z direction.
void ge::Shader::dispatchCompute | ( | vmml::Vector3ui | _numGroups | ) | const |
dispatches a compute command : : a vector containing the number of group in X, Y, Z directions
GLuint ge::Shader::getHandle | ( | ) |
GLuint ge::Shader::getUniformBlockIndex | ( | std::string | _input | ) |
GLuint ge::Shader::getVertexArrayAttributeCount | ( | ) | const |
void ge::Shader::load | ( | std::string | _inputPath, |
ge::Shader::ShaderType | _type, | ||
std::string | _genericShaderPath = "" |
||
) |
void ge::Shader::load | ( | std::string | _repopath, |
std::string | _relPath, | ||
ge::Shader::ShaderType | _type, | ||
std::string | _genericShaderPath = "" |
||
) |
void ge::Shader::loadFromSourceVertFrag | ( | std::string | _vertSource, |
std::string | _fragSource | ||
) |
|
static |
void ge::Shader::recompile | ( | ShaderProgram::ReloadType | _type = ShaderProgram::ReloadType::FROMFILE | ) |
recompiles all shader programs for this shader and links them again. Can only be called on shaders w
void ge::Shader::setDefinesToZeroWithoutRecompile | ( | ) |
void ge::Shader::setUniform1d | ( | std::string | _name, |
double | _value | ||
) | const |
void ge::Shader::setUniform1f | ( | std::string | _name, |
float | _value | ||
) | const |
void ge::Shader::setUniformBlockBinding | ( | std::string | _ublockName, |
GLuint | _ublockBinding | ||
) |
void ge::Shader::setUniformBlockBinding | ( | GLuint | _ublockIdx, |
GLuint | _ublockBinding | ||
) |
void ge::Shader::setUniformMatrix3d | ( | std::string | _name, |
vmml::Matrix3d | _value, | ||
bool | _transpose = false |
||
) | const |
void ge::Shader::setUniformMatrix3f | ( | std::string | _name, |
vmml::Matrix3f | _value, | ||
bool | _transpose = false |
||
) | const |
void ge::Shader::setUniformMatrix4d | ( | std::string | _name, |
vmml::Matrix4d | _value, | ||
bool | _transpose = false |
||
) | const |
void ge::Shader::setUniformMatrix4f | ( | std::string | _name, |
vmml::Matrix4f | _value, | ||
bool | _transpose = false |
||
) | const |
void ge::Shader::setUniformVector2d | ( | std::string | _name, |
vmml::Vector2d | _value | ||
) | const |
void ge::Shader::setUniformVector2f | ( | std::string | _name, |
vmml::Vector2f | _value | ||
) | const |
void ge::Shader::setUniformVector2i | ( | std::string | _name, |
vmml::Vector2i | _value | ||
) | const |
void ge::Shader::setUniformVector3d | ( | std::string | _name, |
vmml::Vector3d | _value | ||
) | const |
void ge::Shader::setUniformVector3f | ( | std::string | _name, |
vmml::Vector3f | _value | ||
) | const |
void ge::Shader::setUniformVector4d | ( | std::string | _name, |
vmml::Vector4d | _value | ||
) | const |
void ge::Shader::setUniformVector4f | ( | std::string | _name, |
vmml::Vector4f | _value | ||
) | const |
void ge::Shader::setUniformVector4f | ( | std::string | _name, |
const float * | _values | ||
) | const |
void ge::Shader::unbind | ( | ) | const |