X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fshader.cpp;h=43b3910096789bb4aaece8133abd8ac2b42e75a4;hb=753be639d7d04f9f7415db9fc2721485c531f0a1;hp=e01c11fcc1aac8f282aaaec1804d9eb32f708ca6;hpb=f62562b0f87d571bd7b32ae2f8ca659c24e9911b;p=blank.git diff --git a/src/shader.cpp b/src/shader.cpp index e01c11f..43b3910 100644 --- a/src/shader.cpp +++ b/src/shader.cpp @@ -211,7 +211,19 @@ void DirectionalLighting::SetLightDirection(const glm::vec3 &dir) { glUniform3f(light_direction_handle, light_direction.x, light_direction.y, light_direction.z); } +void DirectionalLighting::SetProjection(const glm::mat4 &p) { + projection = p; + vp = p * view; +} + +void DirectionalLighting::SetView(const glm::mat4 &v) { + view = v; + vp = projection * v; +} + void DirectionalLighting::SetVP(const glm::mat4 &v, const glm::mat4 &p) { + projection = p; + view = v; vp = p * v; }