summaryrefslogtreecommitdiff
path: root/advanced_lighting/3.2.point_shadows/shaders/depth.geom
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/3.2.point_shadows/shaders/depth.geom
parent926cbd0d49890772f911e6a6bedb7835605ced89 (diff)
quite a lot of changes that I, of course, are not going to describe;)
Diffstat (limited to 'advanced_lighting/3.2.point_shadows/shaders/depth.geom')
-rw-r--r--advanced_lighting/3.2.point_shadows/shaders/depth.geom20
1 files changed, 20 insertions, 0 deletions
diff --git a/advanced_lighting/3.2.point_shadows/shaders/depth.geom b/advanced_lighting/3.2.point_shadows/shaders/depth.geom
new file mode 100644
index 0000000..de39788
--- /dev/null
+++ b/advanced_lighting/3.2.point_shadows/shaders/depth.geom
@@ -0,0 +1,20 @@
+#version 330 core
+layout(triangles) in;
+layout(triangle_strip, max_vertices=18) out;
+
+uniform mat4 shadow_transforms[6];
+
+out vec4 frag_pos;
+
+void main(void)
+{
+ for (int face = 0; face < 6; ++face) {
+ gl_Layer = face;
+ for (int vertex = 0; vertex < 3; ++vertex) {
+ frag_pos = gl_in[vertex].gl_Position;
+ gl_Position = shadow_transforms[face]*frag_pos;
+ EmitVertex();
+ }
+ EndPrimitive();
+ }
+}