summaryrefslogtreecommitdiff
path: root/themes/src/_shaders
diff options
context:
space:
mode:
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
-rw-r--r--themes/src/_shaders/sun.vert0
5 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;
+}
diff --git a/themes/src/_shaders/sun.vert b/themes/src/_shaders/sun.vert
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/themes/src/_shaders/sun.vert