void SetM(const glm::mat4 &m) noexcept;
void SetVP(const glm::mat4 &v, const glm::mat4 &p) noexcept;
void SetMVP(const glm::mat4 &m, const glm::mat4 &v, const glm::mat4 &p) noexcept;
- void SetColor(const glm::vec3 &color) noexcept;
+ void SetColor(const glm::vec4 &color) noexcept;
const glm::mat4 &M() const noexcept { return m; }
const glm::mat4 &V() const noexcept { return v; }
GL_FRAGMENT_SHADER,
"#version 330 core\n"
- "uniform vec3 fg_color;\n"
+ "uniform vec4 fg_color;\n"
- "out vec3 color;\n"
+ "out vec4 color;\n"
"void main() {\n"
"color = fg_color;\n"
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glEnable(GL_CULL_FACE);
- glDisable(GL_BLEND);
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
void PlainColor::SetM(const glm::mat4 &mm) noexcept {
prog.Uniform(mvp_handle, mvp);
}
-void PlainColor::SetColor(const glm::vec3 &color) noexcept {
+void PlainColor::SetColor(const glm::vec4 &color) noexcept {
prog.Uniform(fg_color_handle, color);
}