From f9ad6fa902c1167d7622ee7af2617d14b62bee21 Mon Sep 17 00:00:00 2001 From: pryazha Date: Wed, 19 Feb 2025 22:26:48 +0500 Subject: quite a lot of changes that I, of course, are not going to describe;) --- advanced_lighting/3.2.point_shadows/shaders/depth.frag | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 advanced_lighting/3.2.point_shadows/shaders/depth.frag (limited to 'advanced_lighting/3.2.point_shadows/shaders/depth.frag') diff --git a/advanced_lighting/3.2.point_shadows/shaders/depth.frag b/advanced_lighting/3.2.point_shadows/shaders/depth.frag new file mode 100644 index 0000000..f95c0f8 --- /dev/null +++ b/advanced_lighting/3.2.point_shadows/shaders/depth.frag @@ -0,0 +1,13 @@ +#version 330 core + +in vec4 frag_pos; + +uniform vec3 light_pos; +uniform float far; + +void main(void) +{ + float light_distance = length(frag_pos.xyz-light_pos); + light_distance = light_distance/far; + gl_FragDepth = light_distance; +} -- cgit v1.2.3