X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fshader.cpp;h=e01c11fcc1aac8f282aaaec1804d9eb32f708ca6;hb=d6435142245c019523b9385048d6d79bdd2565f2;hp=99bdb74dec9995727f44470b8cddd34d85489739;hpb=982b69ce8c393ae18beed5239191b8bc2ee1d5d1;p=blank.git diff --git a/src/shader.cpp b/src/shader.cpp index 99bdb74..e01c11f 100644 --- a/src/shader.cpp +++ b/src/shader.cpp @@ -206,6 +206,11 @@ void DirectionalLighting::SetM(const glm::mat4 &m) { glUniformMatrix4fv(mvp_handle, 1, GL_FALSE, &mvp[0][0]); } +void DirectionalLighting::SetLightDirection(const glm::vec3 &dir) { + light_direction = -dir; + glUniform3f(light_direction_handle, light_direction.x, light_direction.y, light_direction.z); +} + void DirectionalLighting::SetVP(const glm::mat4 &v, const glm::mat4 &p) { vp = p * v; }