From a07d2024178106df99b82fe21a34402c5200e8f6 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 15 Apr 2023 00:21:32 +0100 Subject: Add the dynamicPoint shader for instancing Same as dynamicPoint, but the model matrix is a vertex input --- gfx/gl/sceneShader.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gfx/gl/sceneShader.h') diff --git a/gfx/gl/sceneShader.h b/gfx/gl/sceneShader.h index ed1bb79..0ccf152 100644 --- a/gfx/gl/sceneShader.h +++ b/gfx/gl/sceneShader.h @@ -80,6 +80,7 @@ public: SceneShader(); BasicProgram basic; + SceneProgram basicInst; WaterProgram water; AbsolutePosProgram landmass, absolute; PointLightShader pointLight; -- cgit v1.2.3 From e4414150da485a8aacdd221e23cad801f8d532c6 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 17 Apr 2023 17:04:32 +0100 Subject: Fix up the way spotlight shader works Was mostly through lack of understanding and coincidences. Position is now the only vertex data, direction is moved to a uniform. Instancing will address this by making everything instance data. --- gfx/gl/sceneShader.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gfx/gl/sceneShader.h') diff --git a/gfx/gl/sceneShader.h b/gfx/gl/sceneShader.h index 0ccf152..c135050 100644 --- a/gfx/gl/sceneShader.h +++ b/gfx/gl/sceneShader.h @@ -69,6 +69,7 @@ class SceneShader { const float arc) const; private: + UniformLocation directionLoc; UniformLocation colourLoc; UniformLocation kqLoc; UniformLocation arcLoc; -- cgit v1.2.3 From 2c4198bc83b5007a3ba7c00f85e4e70fcb9f6177 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 19 Apr 2023 02:05:56 +0100 Subject: Fix type of basic instanced shader It's now AbsolutePosProgram, which is kind of right, in that it takes no location data via uniform, it's all in the vertex data. --- gfx/gl/sceneShader.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gfx/gl/sceneShader.h') diff --git a/gfx/gl/sceneShader.h b/gfx/gl/sceneShader.h index c135050..ead184e 100644 --- a/gfx/gl/sceneShader.h +++ b/gfx/gl/sceneShader.h @@ -81,9 +81,8 @@ public: SceneShader(); BasicProgram basic; - SceneProgram basicInst; WaterProgram water; - AbsolutePosProgram landmass, absolute; + AbsolutePosProgram basicInst, landmass, absolute; PointLightShader pointLight; SpotLightShader spotLight; -- cgit v1.2.3