summaryrefslogtreecommitdiff
path: root/ui/sceneRenderer.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-11-27 12:51:11 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-11-27 12:51:11 +0000
commit69d95f35512772fb42e04808cffabcdc82afed96 (patch)
treed3059c89e3b2372e929932bd22dc0e7e42252e23 /ui/sceneRenderer.h
parentChange pointlight render area definition to a cube (diff)
downloadilt-69d95f35512772fb42e04808cffabcdc82afed96.tar.bz2
ilt-69d95f35512772fb42e04808cffabcdc82afed96.tar.xz
ilt-69d95f35512772fb42e04808cffabcdc82afed96.zip
SceneRenderer is a graphics component, not a UI one
Diffstat (limited to 'ui/sceneRenderer.h')
-rw-r--r--ui/sceneRenderer.h55
1 files changed, 0 insertions, 55 deletions
diff --git a/ui/sceneRenderer.h b/ui/sceneRenderer.h
deleted file mode 100644
index f40b894..0000000
--- a/ui/sceneRenderer.h
+++ /dev/null
@@ -1,55 +0,0 @@
-#pragma once
-
-#include "gfx/gl/camera.h"
-#include "gfx/gl/program.h"
-#include "gfx/gl/sceneShader.h"
-#include "lib/glArrays.h"
-#include <functional>
-#include <glm/fwd.hpp>
-
-class SceneRenderer {
-public:
- class SceneProvider {
- 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);
-
- void render(const SceneProvider &) const;
- void setAmbientLight(const glm::vec3 & colour) const;
- void setDirectionalLight(const glm::vec3 & colour, const glm::vec3 & direction) const;
-
- Camera camera;
-
-private:
- glm::ivec2 size;
- GLuint output;
- glFrameBuffer gBuffer;
- glTexture gPosition, gNormal, gAlbedoSpec, gIllumination;
- glRenderBuffer depth;
- class DeferredLightProgram : public Program {
- public:
- using Program::Program;
- using Program::use;
- };
- class DirectionalLightProgram : public Program {
- public:
- DirectionalLightProgram();
- using Program::use;
-
- void setDirectionalLight(const glm::vec3 &, const glm::vec3 &) const;
-
- private:
- RequiredUniformLocation directionLoc, colourLoc;
- };
-
- DeferredLightProgram lighting;
- DirectionalLightProgram dirLight;
- glVertexArray displayVAO;
- glBuffer displayVBO;
- SceneShader shader;
-};