summaryrefslogtreecommitdiff
path: root/gfx/gl/shadowMapper.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-28 02:25:11 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-28 02:25:11 +0000
commit892513f81ed68e05d4dedb99f51de5bc46cab6b2 (patch)
tree19209bc3f1c58123bd497c7c555ac8c7d251c351 /gfx/gl/shadowMapper.h
parentSet light view point uniform once (diff)
downloadilt-892513f81ed68e05d4dedb99f51de5bc46cab6b2.tar.bz2
ilt-892513f81ed68e05d4dedb99f51de5bc46cab6b2.tar.xz
ilt-892513f81ed68e05d4dedb99f51de5bc46cab6b2.zip
Geometry shader for single pass shadow maps
2D array texture, 4 levels, geometry shader outputs to each layer for a specific band, single scene rendering. Pending massive tidy up.
Diffstat (limited to 'gfx/gl/shadowMapper.h')
-rw-r--r--gfx/gl/shadowMapper.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/gfx/gl/shadowMapper.h b/gfx/gl/shadowMapper.h
index 065db4f..421e6a5 100644
--- a/gfx/gl/shadowMapper.h
+++ b/gfx/gl/shadowMapper.h
@@ -26,25 +26,29 @@ public:
class FixedPoint : public Program {
public:
- FixedPoint(const Shader & vs);
- void setViewPoint(const GlobalPosition3D) const;
- void setViewProjection(const glm::mat4 &) const;
+ FixedPoint(const Shader & vs, const Shader & gs);
+ void setViewPoint(const GlobalPosition3D, size_t n) const;
+ void setViewProjection(const glm::mat4 &, size_t n) const;
void use() const;
private:
- RequiredUniformLocation viewProjectionLoc, viewPointLoc;
+ std::array<RequiredUniformLocation, 4> viewProjectionLoc;
+ RequiredUniformLocation viewProjectionsLoc;
+ RequiredUniformLocation viewPointLoc;
};
class DynamicPoint : public Program {
public:
DynamicPoint();
- void setViewPoint(const GlobalPosition3D) const;
- void setViewProjection(const glm::mat4 &) const;
+ void setViewPoint(const GlobalPosition3D, size_t n) const;
+ void setViewProjection(const glm::mat4 &, size_t n) const;
void use(const Location &) const;
void setModel(const Location &) const;
private:
- RequiredUniformLocation viewProjectionLoc, viewPointLoc;
+ std::array<RequiredUniformLocation, 4> viewProjectionLoc;
+ RequiredUniformLocation viewProjectionsLoc;
+ RequiredUniformLocation viewPointLoc;
RequiredUniformLocation modelLoc;
RequiredUniformLocation modelPosLoc;
};