diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-14 11:38:09 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-14 11:38:09 +0000 |
commit | 08128c14ec49a2b357e830c832ccd0a8e63c175d (patch) | |
tree | 6634dea4e5d8bac32bdcf1c2ea68000874c61a5a /gfx/gl/sceneRenderer.cpp | |
parent | We only need 3x3 matrix for model rotation spec (diff) | |
download | ilt-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.cpp | 12 |
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); } |