summaryrefslogtreecommitdiff
path: root/gfx/gl/sceneShader.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-22 02:25:47 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-22 02:25:47 +0000
commit961f69d8cda0364c04ec98efc70a6f21e0a091e6 (patch)
treebffeb04832ea6615cc9d3908a6de1c8fb01e9bd6 /gfx/gl/sceneShader.h
parentAdd missing support for glUniform simple span of numbers (diff)
downloadilt-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.h14
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;