diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-07-07 23:21:25 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-07-07 23:21:25 +0100 |
commit | 07064efcfecb0f1140f829ee2481079fa02cc587 (patch) | |
tree | ad9914fc74c46cacbfb6a1187ce99cb89171521a /gfx/gl/shadowMapper.h | |
parent | Add shadow shader which takes into account texture transparency (diff) | |
download | ilt-07064efcfecb0f1140f829ee2481079fa02cc587.tar.bz2 ilt-07064efcfecb0f1140f829ee2481079fa02cc587.tar.xz ilt-07064efcfecb0f1140f829ee2481079fa02cc587.zip |
Simplify setup of uniform locations and containing programs
Diffstat (limited to 'gfx/gl/shadowMapper.h')
-rw-r--r-- | gfx/gl/shadowMapper.h | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/gfx/gl/shadowMapper.h b/gfx/gl/shadowMapper.h index 967d93b..73dadd0 100644 --- a/gfx/gl/shadowMapper.h +++ b/gfx/gl/shadowMapper.h @@ -30,14 +30,9 @@ public: void use() const; private: - RequiredUniformLocation viewProjectionLoc; - RequiredUniformLocation viewProjectionsLoc; - RequiredUniformLocation viewPointLoc; - }; - - class FixedPoint : public ShadowProgram { - public: - explicit FixedPoint(const Shader & vs); + RequiredUniformLocation viewProjectionLoc {*this, "viewProjection"}; + RequiredUniformLocation viewProjectionsLoc {*this, "viewProjections"}; + RequiredUniformLocation viewPointLoc {*this, "viewPoint"}; }; class DynamicPoint : public ShadowProgram { @@ -47,12 +42,11 @@ public: void setModel(const Location &) const; private: - RequiredUniformLocation modelLoc; - RequiredUniformLocation modelPosLoc; + RequiredUniformLocation modelLoc {*this, "model"}; + RequiredUniformLocation modelPosLoc {*this, "modelPos"}; }; - FixedPoint landmess, dynamicPointInst; - ShadowProgram dynamicPointInstWithTextures; + ShadowProgram landmess, dynamicPointInst, dynamicPointInstWithTextures; DynamicPoint dynamicPoint; // NOLINTNEXTLINE(hicpp-explicit-conversions) |