From 05aa5178f7b0cf0962d4125a6a0af76a972150f2 Mon Sep 17 00:00:00 2001 From: iurii plugatarov Date: Sun, 18 Aug 2024 20:44:13 +0300 Subject: light --- res/shaders/colors.fs | 11 +++++++++++ res/shaders/colors.vs | 11 +++++++++++ res/shaders/light_cube.fs | 7 +++++++ res/shaders/light_cube.vs | 11 +++++++++++ 4 files changed, 40 insertions(+) create mode 100644 res/shaders/colors.fs create mode 100644 res/shaders/colors.vs create mode 100644 res/shaders/light_cube.fs create mode 100644 res/shaders/light_cube.vs (limited to 'res/shaders') 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); +} -- cgit 1.4.1-2-gfad0