Add basic phong lighting

(ambient+diffuse+specular)
This commit is contained in:
4VRDriver
2020-09-06 14:59:53 +02:00
parent e4139105ee
commit 192082043e
11 changed files with 110 additions and 29 deletions

View File

@@ -111,6 +111,11 @@ void ShaderProgram::setUniform(const char *name, glm::vec3 vector) const {
glUniform3f(location, vector.x, vector.y, vector.z);
}
void ShaderProgram::setUniform(const char *name, glm::mat3 matrix) const {
GLint location = glGetUniformLocation(shaderProgramId, name);
glUniformMatrix3fv(location, 1, GL_FALSE, glm::value_ptr(matrix));
}
void ShaderProgram::setUniform(const char *name, glm::mat4 matrix) const {
GLint location = glGetUniformLocation(shaderProgramId, name);
glUniformMatrix4fv(location, 1, GL_FALSE, glm::value_ptr(matrix));