mirror of
https://github.com/LearnOpenGL-CN/LearnOpenGL-CN.git
synced 2025-08-23 04:35:28 +08:00
@@ -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;
|
||||
}
|
||||
```
|
||||
|
Reference in New Issue
Block a user