From cf10ef57bc38294f945ffd3a3b9cf199a749a470 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 26 Jan 2021 21:10:37 +0000 Subject: Define light direction as a vector --- gfx/gl/shader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gfx/gl/shader.cpp b/gfx/gl/shader.cpp index 31feb80..7fcdefe 100644 --- a/gfx/gl/shader.cpp +++ b/gfx/gl/shader.cpp @@ -36,7 +36,8 @@ void Shader::setView(glm::mat4 proj) const { glUniformMatrix4fv(viewProjection_uniform, 1, GL_FALSE, &proj[0][0]); - glUniform3f(lightDir_uniform, 0.0F, -1.0F, 0.0F); + const glm::vec3 lightDir = glm::normalize(glm::vec3 {1, -1, 0}); + glUniform3fv(lightDir_uniform, 1, &lightDir[0]); } void -- cgit v1.2.3