31 #include <glm/gtc/type_ptr.hpp>
32 #include <glm/mat4x4.hpp>
34 #include "eng3d/texture.hpp"
35 #include "eng3d/glsl_trans.hpp"
36 #include "eng3d/utils.hpp"
48 virtual const char*
what() const noexcept {
49 return buffer.c_str();
77 void compile(
unsigned int type);
80 std::vector<int> line_numbers;
82 Shader(
const std::string& _buffer,
unsigned int type,
bool use_transpiler =
true, std::vector<Eng3D::GLSL::Define> defintions = {});
95 FragmentShader(
const std::string& _buffer,
bool use_transpiler =
true, std::vector<Eng3D::GLSL::Define> defintions = {});
99 #if !defined E3D_BACKEND_GLES
127 void set_PVM(glm::mat4 projection, glm::mat4 view, glm::mat4 model)
const;
128 void set_uniform(
const std::string& name, glm::mat4 uniform)
const;
129 void set_uniform(
const std::string& name,
float value1,
float value2)
const;
130 void set_uniform(
const std::string& name,
float value1,
float value2,
float value3)
const;
131 void set_uniform(
const std::string& name, glm::vec2 uniform)
const;
132 void set_uniform(
const std::string& name, glm::vec3 uniform)
const;
133 void set_uniform(
const std::string& name, glm::vec4 uniform)
const;
134 void set_uniform(
const std::string& name,
float value1,
float value2,
float value3,
float value4)
const;
~FragmentShader()=default
FragmentShader(const std::string &_buffer, bool use_transpiler=true, std::vector< Eng3D::GLSL::Define > defintions={})
GeometryShader(const std::string &_buffer)
~GeometryShader()=default
Option that is passed to the GLSL transpiler for preprocessing the shaders and programming them on th...
std::string get_option() const
Option(std::string option, bool use)
void set_uniform(const std::string &name, int value) const
void set_uniform(const std::string &name, glm::vec4 uniform) const
void set_uniform(const std::string &name, float value1, float value2) const
void set_uniform(const std::string &name, float value) const
void set_texture(int value, const std::string &name, const Eng3D::Texture &texture) const
void set_texture(int value, const std::string &name, const Eng3D::TextureArray &texture) const
void set_uniform(const std::string &name, float value1, float value2, float value3, float value4) const
void attach_shader(const Eng3D::OpenGL::Shader &shader)
void set_uniform(const std::string &name, glm::mat4 uniform) const
void set_uniform(const std::string &name, float value1, float value2, float value3) const
void set_uniform(const std::string &name, glm::vec2 uniform) const
unsigned int get_id() const
void set_PVM(glm::mat4 projection, glm::mat4 view, glm::mat4 model) const
void set_uniform(const std::string &name, glm::vec3 uniform) const
unsigned int get_id() const
Shader(const std::string &_buffer, unsigned int type, bool use_transpiler=true, std::vector< Eng3D::GLSL::Define > defintions={})
TessControlShader(const std::string &_buffer)
~TessControlShader()=default
TessEvalShader(const std::string &_buffer)
~TessEvalShader()=default
VertexShader(const std::string &_buffer)
ShaderException(const std::string &_buffer)
virtual const char * what() const noexcept