diff options
Diffstat (limited to 'gfx/gl/sceneRenderer.h')
| -rw-r--r-- | gfx/gl/sceneRenderer.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/gfx/gl/sceneRenderer.h b/gfx/gl/sceneRenderer.h index 31f0cda..2901dea 100644 --- a/gfx/gl/sceneRenderer.h +++ b/gfx/gl/sceneRenderer.h @@ -1,7 +1,9 @@ #pragma once +#include "billboardPainter.h" +#include "gfx/gl/glFramebuffer.h" #include "gfx/lightDirection.h" -#include "glArrays.h" +#include "gldebug.h" #include "program.h" #include "sceneProvider.h" #include "sceneShader.h" @@ -11,10 +13,12 @@ class SceneRenderer { public: - explicit SceneRenderer(ScreenAbsCoord size, GLuint output); + SceneRenderer(ScreenAbsCoord size, GLuint output); + SceneRenderer(ScreenAbsCoord size, GLuint output, glDebugScope); void resize(ScreenAbsCoord size); + void preFrame(const SceneProvider & scene, LightDirection lightDirection); void render(const SceneProvider &) const; void setAmbientLight(const RGB & colour) const; void setDirectionalLight(const RGB & colour, const LightDirection & direction, const SceneProvider &) const; @@ -23,13 +27,13 @@ public: protected: void renderQuad() const; + void configureBuffers(); ScreenAbsCoord size; GLuint output; - glFrameBuffer gBuffer, gBufferIll; - GLint normaliFormat; - glTexture gPosition, gNormal, gAlbedoSpec, gIllumination; - glRenderBuffer depth; + glFramebuffer gBuffer, gBufferIll; + glTexture<GL_TEXTURE_2D> gPosition, gNormal, gAlbedoSpec, gIllumination; + glRenderbuffer depth; class DeferredLightProgram : public Program { public: @@ -42,13 +46,11 @@ protected: DirectionalLightProgram(); using Program::use; - void setDirectionalLight( - const RGB &, const Direction3D &, const GlobalPosition3D &, const std::span<const glm::mat4x4>) const; + void setDirectionalLight(const RGB &, const Direction3D &, const std::span<const glm::mat4x4>) const; private: RequiredUniformLocation directionLoc {*this, "lightDirection"}; RequiredUniformLocation colourLoc {*this, "lightColour"}; - RequiredUniformLocation lightPointLoc {*this, "lightPoint"}; RequiredUniformLocation lightViewProjectionLoc {*this, "lightViewProjection"}; RequiredUniformLocation lightViewProjectionCountLoc {*this, "lightViewProjectionCount"}; }; @@ -59,4 +61,5 @@ protected: glBuffer displayVBO; SceneShader shader; ShadowMapper shadowMapper; + BillboardPainter billboardPainter; }; |
