summaryrefslogtreecommitdiff
path: root/advanced_lighting/9.ssao/gbuffer.vert
diff options
context:
space:
mode:
authorpryazha <pryadeiniv@mail.ru>2025-06-15 16:11:31 +0500
committerpryazha <pryadeiniv@mail.ru>2025-06-15 16:11:31 +0500
commit9d944f26d359e4bc1ffd8e44350b0df9f0935b18 (patch)
tree9759a83a76ab741a587b99f00c2463eafd05d813 /advanced_lighting/9.ssao/gbuffer.vert
parentd65ddd07a43d5ffdcf2ddf90d6f86626cf9b92d8 (diff)
something
Diffstat (limited to 'advanced_lighting/9.ssao/gbuffer.vert')
-rw-r--r--advanced_lighting/9.ssao/gbuffer.vert21
1 files changed, 21 insertions, 0 deletions
diff --git a/advanced_lighting/9.ssao/gbuffer.vert b/advanced_lighting/9.ssao/gbuffer.vert
new file mode 100644
index 0000000..81ab951
--- /dev/null
+++ b/advanced_lighting/9.ssao/gbuffer.vert
@@ -0,0 +1,21 @@
+#version 330 core
+
+layout (location = 0) in vec3 position;
+layout (location = 1) in vec3 normal;
+
+out vert_t {
+ vec3 position;
+ vec3 normal;
+} vert;
+
+uniform mat4 projection;
+uniform mat4 view;
+uniform mat4 model;
+
+void main()
+{
+ vert.position = vec3(view * model * vec4(position, 1.0));
+ mat3 matrix_normal = transpose(inverse(mat3(view * model)));
+ vert.normal = matrix_normal * normal;
+ gl_Position = projection * view * model * vec4(position, 1.0);
+}