Correct for non uniform scale in lighting

This commit is contained in:
Dane Johnson
2021-01-23 12:33:10 -06:00
parent 5c4ac7712d
commit 5e8e7b3ce0
20 changed files with 21 additions and 11 deletions

View File

@@ -53,6 +53,10 @@ void Shader::UpdateProjection(Matrix projection) {
glUniformMatrix4fv(glGetUniformLocation(id, "PROJECTION"), 1, GL_FALSE, glm::value_ptr(projection));
}
void Shader::UpdateNormal(glm::mat3 normal) {
glUniformMatrix3fv(glGetUniformLocation(id, "NORMAL"), 1, GL_FALSE, glm::value_ptr(normal));
}
void Shader::UpdateMaterial(Material material) {
glUniform1i(glGetUniformLocation(id, "material.usesTex"), (int) material.usesTex);
if (material.usesTex) {

View File

@@ -16,6 +16,7 @@ public:
void UpdateView(Matrix view);
void UpdateModel(Matrix model);
void UpdateProjection(Matrix projection);
void UpdateNormal(glm::mat3 normal);
void UpdateMaterial(Material material);