summaryrefslogtreecommitdiff
path: root/shaders
diff options
context:
space:
mode:
authorAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2024-02-07 22:49:00 +0100
committerAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2024-02-07 22:49:00 +0100
commit35a70d71f62e41d78d68247075ce174f2b6d997a (patch)
treec9af8d8c44256abfc100c396182fd27f1f4c7263 /shaders
inital commit -- THE CUBES SPIN
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
Diffstat (limited to 'shaders')
-rw-r--r--shaders/shader.frag8
-rw-r--r--shaders/shader.vert22
2 files changed, 30 insertions, 0 deletions
diff --git a/shaders/shader.frag b/shaders/shader.frag
new file mode 100644
index 0000000..a4ce603
--- /dev/null
+++ b/shaders/shader.frag
@@ -0,0 +1,8 @@
+#version 450
+
+layout(location = 0) in vec4 fragColor;
+layout(location = 0) out vec4 outColor;
+
+void main() {
+ outColor = fragColor;
+}
diff --git a/shaders/shader.vert b/shaders/shader.vert
new file mode 100644
index 0000000..48f67d6
--- /dev/null
+++ b/shaders/shader.vert
@@ -0,0 +1,22 @@
+#version 450
+
+layout(location = 0) in vec3 in_position;
+layout(location = 1) in vec3 in_normal;
+layout(location = 2) in vec4 in_color;
+
+layout(location = 0) out vec4 frag_color;
+
+layout(set = 0, binding = 0) uniform mvp {
+ mat4 model;
+ mat4 view;
+ mat4 proj;
+} ubo;
+
+layout(push_constant) uniform mesh_data {
+ mat4 transform;
+} mesh;
+
+void main() {
+ gl_Position = ubo.proj * ubo.view * ubo.model * mesh.transform * ubo.model * vec4(in_position, 1.0);
+ frag_color = gl_Position;
+}