summaryrefslogtreecommitdiff
path: root/gfx/gl/sceneShader.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-24 00:46:57 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-24 00:46:57 +0000
commit17aa6053e641d006649f94bb60a834ce945f351e (patch)
treeb76f6fc642b749ee69d4be4b2e3f60e80c0ed7bc /gfx/gl/sceneShader.h
parentAdd traits wrapper for setting uniforms (diff)
parentFix network population of position in gBuffer (diff)
downloadilt-17aa6053e641d006649f94bb60a834ce945f351e.tar.bz2
ilt-17aa6053e641d006649f94bb60a834ce945f351e.tar.xz
ilt-17aa6053e641d006649f94bb60a834ce945f351e.zip
Merge remote-tracking branch 'origin/instanced-networks'
Diffstat (limited to 'gfx/gl/sceneShader.h')
-rw-r--r--gfx/gl/sceneShader.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/gfx/gl/sceneShader.h b/gfx/gl/sceneShader.h
index 813c1bf..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,6 +67,7 @@ public:
BasicProgram basic;
WaterProgram water;
AbsolutePosProgram basicInst, landmass, absolute, spotLightInst, pointLightInst;
+ NetworkProgram networkStraight, networkCurve;
void setViewProjection(const GlobalPosition3D & viewPoint, const glm::mat4 & viewProjection) const;
void setViewPort(const ViewPort & viewPort) const;