9 #ifndef GlobeEngine_Shader_h
10 #define GlobeEngine_Shader_h
12 #include "OpenGL_Includes.h"
16 #include <vmmlib/vmmlib.hpp>
33 Shader(
const std::shared_ptr<Shader> copy) {
34 this->handle = copy->handle;
35 this->vertexArrayAttributeCount = copy->vertexArrayAttributeCount;
36 this->repoPath = copy->repoPath;
37 this->globalSourcePath = copy->globalSourcePath;
38 this->shadertype = copy->shadertype;
39 this->programs = copy->programs;
40 this->vertexArrayAttributeLocations = copy->vertexArrayAttributeLocations;
60 #ifndef GENGINE_GL_BELOW_410
66 void dispatchCompute(GLuint _numGroupsX, GLuint _numGroupsY, GLuint _numGroupsZ)
const;
76 #if defined GENGINE_GL_ES
78 void setUniform1d(std::string _name,
double _value)
const;
82 void setUniformMatrix3d(std::string _name, vmml::Matrix3d _value,
bool _transpose=
false)
const;
83 void setUniformMatrix4d(std::string _name, vmml::Matrix4d _value,
bool _transpose =
false)
const;
89 void setUniform1f(std::string _name,
float _value)
const;
95 void setUniformMatrix3f(std::string _name, vmml::Matrix3f _value,
bool _transpose=
false)
const;
96 void setUniformMatrix4f(std::string _name, vmml::Matrix4f _value,
bool _transpose =
false)
const;
98 void setUniformArrayf(std::string _name,
int _count,
const GLfloat* _values)
const;
105 void setupPrograms(std::vector<std::string> _inputPathOrSource,
bool _isSource);
107 void bindAttributeLocation(
unsigned int _location, std::string _name);
108 void unbindAttributeLocation(
unsigned int _location);
110 void getOpenGLError(std::string _input);
113 void load(std::vector<std::string> _inputPathOrSource,
bool _isSource);
114 void createShaderHandle();
115 void attachProgramID(GLuint _programID);
116 void setupPropertyBuffer();
119 std::map<int, std::string> vertexArrayAttributeLocations;
122 GLuint vertexArrayAttributeCount;
124 std::vector< std::shared_ptr<ge::ShaderProgram> > programs;
125 std::string repoPath;
128 std::string globalSourcePath;
133 typedef std::map<std::string, std::shared_ptr<ge::Shader> >
ShaderMap;
ShaderType
Definition: Shader.h:28
void setUniformBlockBinding(std::string _ublockName, GLuint _ublockBinding)
Definition: Shader.cpp:432
void unbind() const
Definition: Shader.cpp:448
void setUniformVector4f(std::string _name, vmml::Vector4f _value) const
Definition: Shader.cpp:389
void setUniform1f(std::string _name, float _value) const
Definition: Shader.cpp:319
void setUniform1d(std::string _name, double _value) const
Definition: Shader.cpp:331
void setDefinesToZeroWithoutRecompile()
Definition: Shader.cpp:156
GLuint getUniformBlockIndex(std::string _input)
Definition: Shader.cpp:440
void setUniformVector3d(std::string _name, vmml::Vector3d _value) const
Definition: Shader.cpp:341
void setUniform1i(std::string _name, int _value) const
Definition: Shader.cpp:310
std::pair< std::string, std::shared_ptr< ge::Shader > > ShaderMapPair
Definition: Shader.h:134
static void printComputeCapabilities()
Definition: Shader.cpp:461
Shader()
Definition: Shader.cpp:20
void bind() const
Definition: Shader.cpp:444
void setUniformMatrix3d(std::string _name, vmml::Matrix3d _value, bool _transpose=false) const
Definition: Shader.cpp:356
void setUniformMatrix4d(std::string _name, vmml::Matrix4d _value, bool _transpose=false) const
Definition: Shader.cpp:351
void loadFromSourceVertFrag(std::string _vertSource, std::string _fragSource)
Definition: Shader.cpp:75
void setUniformMatrix4f(std::string _name, vmml::Matrix4f _value, bool _transpose=false) const
Definition: Shader.cpp:407
void setUniformVector2f(std::string _name, vmml::Vector2f _value) const
Definition: Shader.cpp:371
IOType
Definition: ShaderParser.h:21
void setDefine1i(std::string _in, int _value)
Definition: Shader.cpp:149
void setUniformVector4d(std::string _name, vmml::Vector4d _value) const
Definition: Shader.cpp:346
void setUniformMatrix3f(std::string _name, vmml::Matrix3f _value, bool _transpose=false) const
Definition: Shader.cpp:416
std::map< std::string, std::shared_ptr< ge::Shader > > ShaderMap
Definition: Shader.h:133
ReloadType
Definition: ShaderProgram.h:27
Definition: AvalancheTrainingSimulationEngine.h:28
void clear()
Definition: Shader.cpp:34
~Shader()
Definition: Shader.cpp:26
void recompile(ShaderProgram::ReloadType _type=ShaderProgram::ReloadType::FROMFILE)
Definition: Shader.cpp:162
void dispatchCompute(GLuint _numGroupsX, GLuint _numGroupsY, GLuint _numGroupsZ) const
Definition: Shader.cpp:453
void setUniformVector2i(std::string _name, vmml::Vector2i _value) const
Definition: Shader.cpp:362
void setUniformArrayf(std::string _name, int _count, const GLfloat *_values) const
Definition: Shader.cpp:426
void setUniformVector3f(std::string _name, vmml::Vector3f _value) const
Definition: Shader.cpp:380
Shader(const std::shared_ptr< Shader > copy)
Definition: Shader.h:33
void load(std::string _inputPath, ge::Shader::ShaderType _type, std::string _genericShaderPath="")
Definition: Shader.cpp:52
GLuint getHandle()
Definition: Shader.cpp:280
GLuint getVertexArrayAttributeCount() const
Definition: Shader.cpp:306
void setUniformVector2d(std::string _name, vmml::Vector2d _value) const
Definition: Shader.cpp:336