From d58ce0baa1ca1103304df93285c55933f77afa34 Mon Sep 17 00:00:00 2001 From: 4VRDriver <44267643+4VRDriver@users.noreply.github.com> Date: Mon, 31 Aug 2020 17:38:35 +0200 Subject: [PATCH] Add defines, basic shaders --- defines.h | 12 ++++++++++++ res/shaders/basic.fs | 9 +++++++++ res/shaders/basic.vs | 11 +++++++++++ 3 files changed, 32 insertions(+) create mode 100644 defines.h create mode 100644 res/shaders/basic.fs create mode 100644 res/shaders/basic.vs diff --git a/defines.h b/defines.h new file mode 100644 index 0000000..8f7812e --- /dev/null +++ b/defines.h @@ -0,0 +1,12 @@ + #pragma once + +struct Vertex { + float x; + float y; + float z; + + float r; + float g; + float b; + float a; +}; diff --git a/res/shaders/basic.fs b/res/shaders/basic.fs new file mode 100644 index 0000000..3957c96 --- /dev/null +++ b/res/shaders/basic.fs @@ -0,0 +1,9 @@ +#version 330 core + +layout(location = 0) out vec4 f_color; + +in vec4 v_color; + +void main() { + f_color = v_color; +} \ No newline at end of file diff --git a/res/shaders/basic.vs b/res/shaders/basic.vs new file mode 100644 index 0000000..c63154f --- /dev/null +++ b/res/shaders/basic.vs @@ -0,0 +1,11 @@ +#version 330 core + +layout(location = 0) in vec3 a_position; +layout(location = 1) in vec4 a_color; + +out vec4 v_color; + +void main() { + gl_Position = vec4(a_position, 1.0f); + v_color = a_color; +} \ No newline at end of file