summaryrefslogtreecommitdiff
path: root/gfx/gl/sceneRenderer.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-14 11:38:09 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-14 11:38:09 +0000
commit08128c14ec49a2b357e830c832ccd0a8e63c175d (patch)
tree6634dea4e5d8bac32bdcf1c2ea68000874c61a5a /gfx/gl/sceneRenderer.cpp
parentWe only need 3x3 matrix for model rotation spec (diff)
downloadilt-08128c14ec49a2b357e830c832ccd0a8e63c175d.tar.bz2
ilt-08128c14ec49a2b357e830c832ccd0a8e63c175d.tar.xz
ilt-08128c14ec49a2b357e830c832ccd0a8e63c175d.zip
Add traits wrapper for setting uniforms
Diffstat (limited to 'gfx/gl/sceneRenderer.cpp')
-rw-r--r--gfx/gl/sceneRenderer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/gfx/gl/sceneRenderer.cpp b/gfx/gl/sceneRenderer.cpp
index c856279..4ae4297 100644
--- a/gfx/gl/sceneRenderer.cpp
+++ b/gfx/gl/sceneRenderer.cpp
@@ -143,11 +143,11 @@ SceneRenderer::DirectionalLightProgram::setDirectionalLight(const RGB & c, const
const GlobalPosition3D & p, const std::span<const glm::mat4x4> lvp,
const std::span<const TextureRelRegion> shadowMapRegions, std::size_t maps) const
{
- glUniform3fv(colourLoc, 1, glm::value_ptr(c));
+ glUniform(colourLoc, c);
const auto nd = glm::normalize(d);
- glUniform3fv(directionLoc, 1, glm::value_ptr(nd));
- glUniform3iv(lightPointLoc, 1, glm::value_ptr(p));
- glUniform1ui(lightViewProjectionCountLoc, static_cast<GLuint>(maps));
- glUniformMatrix4fv(lightViewProjectionLoc, static_cast<GLsizei>(maps), GL_FALSE, glm::value_ptr(lvp.front()));
- glUniform4fv(lightViewShadowMapRegionLoc, static_cast<GLsizei>(maps), glm::value_ptr(shadowMapRegions.front()));
+ glUniform(directionLoc, nd);
+ glUniform(lightPointLoc, p);
+ glUniform(lightViewProjectionCountLoc, static_cast<GLuint>(maps));
+ glUniform(lightViewProjectionLoc, lvp);
+ glUniform(lightViewShadowMapRegionLoc, shadowMapRegions);
}