1
0
mirror of https://github.com/LearnOpenGL-CN/LearnOpenGL-CN.git synced 2025-08-23 04:35:28 +08:00
This commit is contained in:
Krasjet
2019-02-03 15:19:50 -05:00
parent 9fef24af66
commit 8013890ec6
5 changed files with 6 additions and 9 deletions

View File

@@ -193,10 +193,10 @@ void main()
```c++
#version 330 core
in vec4 FragPos;
uniform vec3 lightPos;
uniform float far_plane;
void main()
{
// get distance between fragment and light source
@@ -205,7 +205,7 @@ void main()
// map to [0;1] range by dividing by far_plane
lightDistance = lightDistance / far_plane;
// Write this as modified depth
// write this as modified depth
gl_FragDepth = lightDistance;
}
```