From 35a70d71f62e41d78d68247075ce174f2b6d997a Mon Sep 17 00:00:00 2001 From: "Anna (navi) Figueiredo Gomes" Date: Wed, 7 Feb 2024 22:49:00 +0100 Subject: inital commit -- THE CUBES SPIN Signed-off-by: Anna (navi) Figueiredo Gomes --- shaders/shader.frag | 8 ++++++++ shaders/shader.vert | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 shaders/shader.frag create mode 100644 shaders/shader.vert (limited to 'shaders') 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; +} -- cgit v1.2.3