diff options
author | iurii plugatarov <[email protected]> | 2024-08-18 19:44:13 +0200 |
---|---|---|
committer | iurii plugatarov <[email protected]> | 2024-08-18 19:44:13 +0200 |
commit | 05aa5178f7b0cf0962d4125a6a0af76a972150f2 (patch) | |
tree | dae1b4c8a6db849ea302947d1bdac632c31e9964 /res/shaders | |
parent | 054ed4d4ff5b5cdcd6b813e9821912742ea6a654 (diff) | |
download | funhalla-05aa5178f7b0cf0962d4125a6a0af76a972150f2.tar.gz |
light
Diffstat (limited to '')
-rw-r--r-- | res/shaders/colors.fs | 11 | ||||
-rw-r--r-- | res/shaders/colors.vs | 11 | ||||
-rw-r--r-- | res/shaders/light_cube.fs | 7 | ||||
-rw-r--r-- | res/shaders/light_cube.vs | 11 |
4 files changed, 40 insertions, 0 deletions
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); +} |