summary refs log tree commit diff
path: root/res
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--res/shaders/colors.fs11
-rw-r--r--res/shaders/colors.vs11
-rw-r--r--res/shaders/light_cube.fs7
-rw-r--r--res/shaders/light_cube.vs11
4 files changed, 40 insertions, 0 deletions
diff --git a/res/shaders/colors.fs b/res/shaders/colors.fs
new file mode 100644
index 0000000..a2b8ff4
--- /dev/null
+++ b/res/shaders/colors.fs
@@ -0,0 +1,11 @@
+#version 330 core
+
+out vec4 FragColor;
+
+uniform vec3 object_color;
+uniform vec3 light_color;
+
+void main() {
+  FragColor = vec4(light_color * object_color, 1.0);
+}
+
diff --git a/res/shaders/colors.vs b/res/shaders/colors.vs
new file mode 100644
index 0000000..63a9758
--- /dev/null
+++ b/res/shaders/colors.vs
@@ -0,0 +1,11 @@
+#version 330 core
+
+layout (location = 0) in vec3 a_pos;
+
+uniform mat4 model;
+uniform mat4 view;
+uniform mat4 projection;
+
+void main() {
+  gl_Position = projection * view * model * vec4(a_pos, 1.0);
+}
diff --git a/res/shaders/light_cube.fs b/res/shaders/light_cube.fs
new file mode 100644
index 0000000..006695a
--- /dev/null
+++ b/res/shaders/light_cube.fs
@@ -0,0 +1,7 @@
+#version 330 core
+
+out vec4 FragColor;
+
+void main() {
+  FragColor = vec4(1.0);
+}
diff --git a/res/shaders/light_cube.vs b/res/shaders/light_cube.vs
new file mode 100644
index 0000000..63a9758
--- /dev/null
+++ b/res/shaders/light_cube.vs
@@ -0,0 +1,11 @@
+#version 330 core
+
+layout (location = 0) in vec3 a_pos;
+
+uniform mat4 model;
+uniform mat4 view;
+uniform mat4 projection;
+
+void main() {
+  gl_Position = projection * view * model * vec4(a_pos, 1.0);
+}