summaryrefslogtreecommitdiff
path: root/gfx/gl/sceneShader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/gl/sceneShader.cpp')
-rw-r--r--gfx/gl/sceneShader.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/gfx/gl/sceneShader.cpp b/gfx/gl/sceneShader.cpp
index 2f391fd..de75814 100644
--- a/gfx/gl/sceneShader.cpp
+++ b/gfx/gl/sceneShader.cpp
@@ -60,13 +60,16 @@ SceneShader::SceneProgram::setViewPort(const ViewPort & viewPort) const
}
}
-SceneShader::BasicProgram::BasicProgram() : SceneProgram {dynamicPoint_vs, material_fs}, modelLoc {*this, "model"} { }
+SceneShader::BasicProgram::BasicProgram() :
+ SceneProgram {dynamicPoint_vs, material_fs}, modelLoc {*this, "model"}, modelPosLoc {*this, "modelPos"}
+{
+}
void
SceneShader::BasicProgram::setModel(Location const & location) const
{
- const auto model {glm::translate(location.pos) * rotate_ypr(location.rot)};
- glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(model));
+ glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(rotate_ypr(location.rot)));
+ glUniform3fv(modelPosLoc, 1, glm::value_ptr(location.pos));
}
void