summaryrefslogtreecommitdiff
path: root/gfx/gl/sceneRenderer.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-11-26 13:51:33 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-11-26 14:14:13 +0000
commit7fba471728f2216d7e3b7900297fc3b3531e286c (patch)
tree5caef3b2efc23aefccb215ec9005cd8e7d2e91b8 /gfx/gl/sceneRenderer.h
parentFix todo for handling a terrain walk from outside the mesh (diff)
parentModel positions as integers (diff)
downloadilt-7fba471728f2216d7e3b7900297fc3b3531e286c.tar.bz2
ilt-7fba471728f2216d7e3b7900297fc3b3531e286c.tar.xz
ilt-7fba471728f2216d7e3b7900297fc3b3531e286c.zip
Merge branch 'ints' into terrain
Conflicts fix, compiles, some test failures remain. Trees not added, possibility of OM invalid handle assertion failures, normals broken due to integer overflow in Newell's method.
Diffstat (limited to 'gfx/gl/sceneRenderer.h')
-rw-r--r--gfx/gl/sceneRenderer.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/gfx/gl/sceneRenderer.h b/gfx/gl/sceneRenderer.h
index d4af665..30fd8d3 100644
--- a/gfx/gl/sceneRenderer.h
+++ b/gfx/gl/sceneRenderer.h
@@ -11,34 +11,36 @@
class SceneRenderer {
public:
- explicit SceneRenderer(glm::ivec2 size, GLuint output);
+ explicit SceneRenderer(ScreenAbsCoord 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 SceneProvider &) const;
+ void setAmbientLight(const RGB & colour) const;
+ void setDirectionalLight(const RGB & colour, const Direction3D & direction, const SceneProvider &) const;
Camera camera;
private:
void renderQuad() const;
- glm::ivec2 size;
+ ScreenAbsCoord 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 std::span<const glm::mat4x4>,
- const std::span<const glm::vec4>, std::size_t maps) const;
+ void setDirectionalLight(const RGB &, const Direction3D &, const std::span<const glm::mat4x4>,
+ const std::span<const TextureRelRegion>, std::size_t maps) const;
private:
RequiredUniformLocation directionLoc, colourLoc, lightViewProjectionLoc, lightViewProjectionCountLoc,