diff options
author | pryazha <pryadeiniv@mail.ru> | 2025-02-06 12:38:09 +0500 |
---|---|---|
committer | pryazha <pryadeiniv@mail.ru> | 2025-02-06 12:38:09 +0500 |
commit | 926cbd0d49890772f911e6a6bedb7835605ced89 (patch) | |
tree | ea27e2c84e32ab6d8d29af9e61cd432e30a46bc6 /advanced_lighting/3.2.point_shadows/shaders/depth.fs | |
parent | bf1c59565096ac9774493846cfb15e259d3b0e66 (diff) |
change
Diffstat (limited to 'advanced_lighting/3.2.point_shadows/shaders/depth.fs')
-rw-r--r-- | advanced_lighting/3.2.point_shadows/shaders/depth.fs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/advanced_lighting/3.2.point_shadows/shaders/depth.fs b/advanced_lighting/3.2.point_shadows/shaders/depth.fs new file mode 100644 index 0000000..88fb9e6 --- /dev/null +++ b/advanced_lighting/3.2.point_shadows/shaders/depth.fs @@ -0,0 +1,14 @@ +#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; +} |