summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-11-23 19:07:18 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-11-23 19:07:18 +0000
commit50d6f63fb28c82a35e68914fe941b685d26f6e89 (patch)
tree4a86d800d36341aedee7319307675cd1e6e5b784 /ui
parentSupport setting a viewPort uniform for those shaders which need it (diff)
downloadilt-50d6f63fb28c82a35e68914fe941b685d26f6e89.tar.bz2
ilt-50d6f63fb28c82a35e68914fe941b685d26f6e89.tar.xz
ilt-50d6f63fb28c82a35e68914fe941b685d26f6e89.zip
Add rendering support for point lights
Diffstat (limited to 'ui')
-rw-r--r--ui/gameMainWindow.cpp4
-rw-r--r--ui/gameMainWindow.h1
-rw-r--r--ui/sceneRenderer.cpp1
-rw-r--r--ui/sceneRenderer.h1
4 files changed, 7 insertions, 0 deletions
diff --git a/ui/gameMainWindow.cpp b/ui/gameMainWindow.cpp
index 0e861b4..8e7e711 100644
--- a/ui/gameMainWindow.cpp
+++ b/ui/gameMainWindow.cpp
@@ -60,3 +60,7 @@ GameMainWindow::environment(const SceneShader & s, const SceneRenderer & r) cons
// default for now
SceneRenderer::SceneProvider::environment(s, r);
}
+void
+GameMainWindow::lights(const SceneShader &) const
+{
+}
diff --git a/ui/gameMainWindow.h b/ui/gameMainWindow.h
index 8485266..fbba0cd 100644
--- a/ui/gameMainWindow.h
+++ b/ui/gameMainWindow.h
@@ -16,4 +16,5 @@ public:
private:
void content(const SceneShader &) const override;
void environment(const SceneShader &, const SceneRenderer &) const override;
+ void lights(const SceneShader &) const override;
};
diff --git a/ui/sceneRenderer.cpp b/ui/sceneRenderer.cpp
index dc8e440..a97387e 100644
--- a/ui/sceneRenderer.cpp
+++ b/ui/sceneRenderer.cpp
@@ -79,6 +79,7 @@ SceneRenderer::render(const SceneProvider & scene) const
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, gNormal);
scene.environment(shader, *this);
+ scene.lights(shader);
// Lighting pass
glBindFramebuffer(GL_FRAMEBUFFER, output);
diff --git a/ui/sceneRenderer.h b/ui/sceneRenderer.h
index 8b81d0c..f40b894 100644
--- a/ui/sceneRenderer.h
+++ b/ui/sceneRenderer.h
@@ -14,6 +14,7 @@ public:
virtual ~SceneProvider() = default;
virtual void content(const SceneShader &) const = 0;
virtual void environment(const SceneShader &, const SceneRenderer &) const;
+ virtual void lights(const SceneShader &) const = 0;
};
explicit SceneRenderer(glm::ivec2 size, GLuint output);