summaryrefslogtreecommitdiff
path: root/advanced_lighting/1.blinn_phong/shaders/blinn_phong.vert
diff options
context:
space:
mode:
authorpryazha <pryadeiniv@mail.ru>2025-02-19 22:26:48 +0500
committerpryazha <pryadeiniv@mail.ru>2025-02-19 22:26:48 +0500
commitf9ad6fa902c1167d7622ee7af2617d14b62bee21 (patch)
tree9d78792cf360ed871616a9ea66c4237018292aa7 /advanced_lighting/1.blinn_phong/shaders/blinn_phong.vert
parent926cbd0d49890772f911e6a6bedb7835605ced89 (diff)
quite a lot of changes that I, of course, are not going to describe;)
Diffstat (limited to 'advanced_lighting/1.blinn_phong/shaders/blinn_phong.vert')
-rw-r--r--advanced_lighting/1.blinn_phong/shaders/blinn_phong.vert22
1 files changed, 22 insertions, 0 deletions
diff --git a/advanced_lighting/1.blinn_phong/shaders/blinn_phong.vert b/advanced_lighting/1.blinn_phong/shaders/blinn_phong.vert
new file mode 100644
index 0000000..870e7dc
--- /dev/null
+++ b/advanced_lighting/1.blinn_phong/shaders/blinn_phong.vert
@@ -0,0 +1,22 @@
+#version 330 core
+layout(location = 0) in vec3 apos;
+layout(location = 1) in vec3 anormal;
+layout(location = 2) in vec2 atex_coords;
+
+out VS_OUT {
+ vec3 frag_pos;
+ vec3 normal;
+ vec2 tex_coords;
+} vs_out;
+
+uniform mat4 proj;
+uniform mat4 view;
+uniform mat4 model;
+
+void main(void)
+{
+ vs_out.frag_pos = vec3(model*vec4(apos, 1.0));
+ vs_out.normal = mat3(transpose(inverse(model)))*anormal;
+ vs_out.tex_coords = atex_coords;
+ gl_Position = proj*view*model*vec4(apos, 1.0);
+}