summaryrefslogtreecommitdiff
path: root/themes/src/shaders
diff options
context:
space:
mode:
authormattkae <mattkae@protonmail.com>2023-04-03 06:35:27 -0400
committermattkae <mattkae@protonmail.com>2023-04-03 06:35:27 -0400
commit5d3ff36045bfb11af0f373d5ecee7c9b54e4c4f9 (patch)
tree1877c85fc652603312c1093ff31678ab807616b2 /themes/src/shaders
parent9e21251ea16e594c8ef416cf8a6b8ebbbb42a858 (diff)
Folderized all of the seasons and loading the shaders from a remote source
Diffstat (limited to 'themes/src/shaders')
-rw-r--r--themes/src/shaders/renderer2d.frag0
-rw-r--r--themes/src/shaders/renderer2d.vert0
-rw-r--r--themes/src/shaders/renderer3d.frag7
-rw-r--r--themes/src/shaders/renderer3d.vert15
4 files changed, 22 insertions, 0 deletions
diff --git a/themes/src/shaders/renderer2d.frag b/themes/src/shaders/renderer2d.frag
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/themes/src/shaders/renderer2d.frag
diff --git a/themes/src/shaders/renderer2d.vert b/themes/src/shaders/renderer2d.vert
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/themes/src/shaders/renderer2d.vert
diff --git a/themes/src/shaders/renderer3d.frag b/themes/src/shaders/renderer3d.frag
new file mode 100644
index 0000000..2f50347
--- /dev/null
+++ b/themes/src/shaders/renderer3d.frag
@@ -0,0 +1,7 @@
+varying lowp vec4 VertexColor;
+varying lowp vec4 VertexNormal;
+
+void main() {
+ const lowp vec3 lightDirection = vec3(0.0, 1.0, 0.0);
+ gl_FragColor = vec4(VertexColor.xyz * dot(VertexNormal.xyz, lightDirection), 1);
+}
diff --git a/themes/src/shaders/renderer3d.vert b/themes/src/shaders/renderer3d.vert
new file mode 100644
index 0000000..026285f
--- /dev/null
+++ b/themes/src/shaders/renderer3d.vert
@@ -0,0 +1,15 @@
+attribute vec4 position;
+attribute vec4 color;
+attribute vec4 normal;
+uniform mat4 projection;
+uniform mat4 view;
+uniform mat4 model;
+varying lowp vec4 VertexColor;
+varying lowp vec4 VertexNormal;
+
+void main() {
+ vec4 fragmentPosition = projection * view * model * position;
+ gl_Position = fragmentPosition;
+ VertexColor = color;
+ VertexNormal = normal;
+}