summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gfx/gl/shadowMapper.cpp9
-rw-r--r--gfx/gl/shadowMapper.h1
2 files changed, 5 insertions, 5 deletions
diff --git a/gfx/gl/shadowMapper.cpp b/gfx/gl/shadowMapper.cpp
index 190f20e..4a8d7ec 100644
--- a/gfx/gl/shadowMapper.cpp
+++ b/gfx/gl/shadowMapper.cpp
@@ -179,7 +179,8 @@ ShadowMapper::FixedPoint::use() const
}
ShadowMapper::DynamicPoint::DynamicPoint() :
- Program {shadowDynamicPoint_vs}, viewProjectionLoc {*this, "viewProjection"}, modelLoc {*this, "model"}
+ Program {shadowDynamicPoint_vs}, viewProjectionLoc {*this, "viewProjection"}, modelLoc {*this, "model"},
+ modelPosLoc {*this, "modelPos"}
{
}
@@ -195,13 +196,11 @@ ShadowMapper::DynamicPoint::use(const Location & location) const
{
glUseProgram(*this);
setModel(location);
- const auto model = glm::translate(location.pos) * rotate_ypr(location.rot);
- glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(model));
}
void
ShadowMapper::DynamicPoint::setModel(const Location & 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));
}
diff --git a/gfx/gl/shadowMapper.h b/gfx/gl/shadowMapper.h
index d54734c..b53a7f1 100644
--- a/gfx/gl/shadowMapper.h
+++ b/gfx/gl/shadowMapper.h
@@ -44,6 +44,7 @@ public:
private:
RequiredUniformLocation viewProjectionLoc;
RequiredUniformLocation modelLoc;
+ RequiredUniformLocation modelPosLoc;
};
FixedPoint fixedPoint, dynamicPointInst;