summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-01-26 21:10:37 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-01-26 21:10:37 +0000
commitcf10ef57bc38294f945ffd3a3b9cf199a749a470 (patch)
tree771657266e5c9bc6de3638242c6daca0376198f2 /gfx
parentGenerate some basic flat terrain (diff)
downloadilt-cf10ef57bc38294f945ffd3a3b9cf199a749a470.tar.bz2
ilt-cf10ef57bc38294f945ffd3a3b9cf199a749a470.tar.xz
ilt-cf10ef57bc38294f945ffd3a3b9cf199a749a470.zip
Define light direction as a vector
Diffstat (limited to 'gfx')
-rw-r--r--gfx/gl/shader.cpp3
1 files changed, 2 insertions, 1 deletions
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