diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-22 02:25:47 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-22 02:25:47 +0000 |
commit | 961f69d8cda0364c04ec98efc70a6f21e0a091e6 (patch) | |
tree | bffeb04832ea6615cc9d3908a6de1c8fb01e9bd6 /gfx/gl/sceneShader.h | |
parent | Add missing support for glUniform simple span of numbers (diff) | |
download | ilt-961f69d8cda0364c04ec98efc70a6f21e0a091e6.tar.bz2 ilt-961f69d8cda0364c04ec98efc70a6f21e0a091e6.tar.xz ilt-961f69d8cda0364c04ec98efc70a6f21e0a091e6.zip |
Bind the network profile in as uniforms
Makes the network shaders generic to network type
Diffstat (limited to 'gfx/gl/sceneShader.h')
-rw-r--r-- | gfx/gl/sceneShader.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gfx/gl/sceneShader.h b/gfx/gl/sceneShader.h index c86d157..8621442 100644 --- a/gfx/gl/sceneShader.h +++ b/gfx/gl/sceneShader.h @@ -3,6 +3,7 @@ #include "config/types.h" #include "program.h" #include <glArrays.h> +#include <span> class Location; @@ -41,8 +42,17 @@ class SceneShader { using SceneProgram::SceneProgram; }; - class WaterProgram : public SceneProgram { + class NetworkProgram : public AbsolutePosProgram { public: + template<typename... S> explicit NetworkProgram(S &&...); + + void use(const std::span<const glm::vec3>, const std::span<const float>) const; + + private: + RequiredUniformLocation profileLoc, texturePosLoc, profileLengthLoc; + }; + + class WaterProgram : public SceneProgram { public: WaterProgram(); void use(float waveCycle) const; @@ -57,7 +67,7 @@ public: BasicProgram basic; WaterProgram water; AbsolutePosProgram basicInst, landmass, absolute, spotLightInst, pointLightInst; - AbsolutePosProgram networkStraight, networkCurve; + NetworkProgram networkStraight, networkCurve; void setViewProjection(const GlobalPosition3D & viewPoint, const glm::mat4 & viewProjection) const; void setViewPort(const ViewPort & viewPort) const; |