diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-01-26 21:10:37 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-01-26 21:10:37 +0000 |
commit | cf10ef57bc38294f945ffd3a3b9cf199a749a470 (patch) | |
tree | 771657266e5c9bc6de3638242c6daca0376198f2 /gfx/gl/shader.cpp | |
parent | Generate some basic flat terrain (diff) | |
download | ilt-cf10ef57bc38294f945ffd3a3b9cf199a749a470.tar.bz2 ilt-cf10ef57bc38294f945ffd3a3b9cf199a749a470.tar.xz ilt-cf10ef57bc38294f945ffd3a3b9cf199a749a470.zip |
Define light direction as a vector
Diffstat (limited to 'gfx/gl/shader.cpp')
-rw-r--r-- | gfx/gl/shader.cpp | 3 |
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
|