summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0undefined <oscar@nelin.dk>2025-03-25 20:13:54 +0000
committer0undefined <oscar@nelin.dk>2025-03-25 20:15:37 +0000
commita2dbad8da8e6ada46e7e31440ead412c52ab3e08 (patch)
tree86a0e2502f29a027e589872b6f48bf372742f9af
parent3ee2b1865e6d3f01140a74bf5ac2f48f46744450 (diff)
Add quad shaders
-rw-r--r--resources/quad.frag13
-rw-r--r--resources/quad.vert18
2 files changed, 31 insertions, 0 deletions
diff --git a/resources/quad.frag b/resources/quad.frag
new file mode 100644
index 0000000..3e85ecf
--- /dev/null
+++ b/resources/quad.frag
@@ -0,0 +1,13 @@
+#version 330 core
+
+in vec3 fragColor;
+
+out vec4 color;
+
+//uniform sampler2D textureSampler;
+
+void main() {
+ color.x = fragColor.x;
+ color.y = fragColor.y;
+ color.z = fragColor.z;
+}
diff --git a/resources/quad.vert b/resources/quad.vert
new file mode 100644
index 0000000..4aaf59c
--- /dev/null
+++ b/resources/quad.vert
@@ -0,0 +1,18 @@
+#version 330 core
+
+layout(location = 0) in vec3 pos;
+
+out vec3 fragColor;
+
+uniform mat4 MVP;
+
+void main() {
+
+ gl_Position =
+ //MVP * vec4( pos.x, 1, pos.y, 1);
+ vec4(pos.x, 1.0, pos.y, 1.0);
+
+ fragColor.x = gl_Position.x;
+ fragColor.y = gl_Position.y;
+ fragColor.z = gl_Position.z;
+}