summaryrefslogtreecommitdiff
path: root/ui/sceneRenderer.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-11-03 19:47:46 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-11-03 19:48:31 +0000
commitc3eea71370eb94cff1fd96185458643fab6eb2c5 (patch)
treecb331dd81d9cb36d69e1b659353796ec170a78e4 /ui/sceneRenderer.cpp
parentRename Shader to SceneShader (diff)
downloadilt-c3eea71370eb94cff1fd96185458643fab6eb2c5.tar.bz2
ilt-c3eea71370eb94cff1fd96185458643fab6eb2c5.tar.xz
ilt-c3eea71370eb94cff1fd96185458643fab6eb2c5.zip
Restructure how shaders are worked with
Needs a tidy-up
Diffstat (limited to 'ui/sceneRenderer.cpp')
-rw-r--r--ui/sceneRenderer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/sceneRenderer.cpp b/ui/sceneRenderer.cpp
index 5e03704..6e75dec 100644
--- a/ui/sceneRenderer.cpp
+++ b/ui/sceneRenderer.cpp
@@ -10,7 +10,7 @@ static constexpr std::array<glm::vec4, 4> displayVAOdata {{
{1.0f, 1.0f, 1.0f, 1.0f},
{1.0f, -1.0f, 1.0f, 0.0f},
}};
-SceneRenderer::SceneRenderer(glm::ivec2 size) : lighting {lightingShader_vs.compile(), lightingShader_fs.compile()}
+SceneRenderer::SceneRenderer(glm::ivec2 size) : lighting {lightingShader_vs, lightingShader_fs}
{
glBindVertexArray(displayVAO);
glBindBuffer(GL_ARRAY_BUFFER, displayVBO);
@@ -60,7 +60,6 @@ SceneRenderer::render(std::function<void()> content) const
// Lighting pass
glDisable(GL_BLEND);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glUseProgram(lighting.m_program);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, gPosition);
glActiveTexture(GL_TEXTURE1);
@@ -68,6 +67,7 @@ SceneRenderer::render(std::function<void()> content) const
glActiveTexture(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_2D, gAlbedoSpec);
// TODO Configure lights
+ lighting.use();
glBindVertexArray(displayVAO);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glBindVertexArray(0);