-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make the directional mapping frustum-dependent
- Loading branch information
1 parent
1298cd8
commit a8dc22f
Showing
10 changed files
with
116 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
in vec4 FragPos; | ||
|
||
uniform vec3 lightPos; | ||
uniform float far_plane; | ||
|
||
void main() | ||
{ | ||
float lightDistance = length(FragPos.xyz - lightPos); | ||
lightDistance = lightDistance / far_plane; | ||
gl_FragDepth = lightDistance; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
layout (triangles) in; | ||
layout (triangle_strip, max_vertices=18) out; | ||
|
||
uniform mat4 shadowMatrices[6]; | ||
|
||
out vec4 FragPos; | ||
|
||
void main() | ||
{ | ||
for(int face = 0; face < 6; ++face) | ||
{ | ||
gl_Layer = face; | ||
for(int i = 0; i < 3; ++i){ | ||
FragPos = gl_in[i].gl_Position; | ||
gl_Position = shadowMatrices[face] * FragPos; | ||
EmitVertex(); | ||
} | ||
EndPrimitive(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
uniform mat4 rotation; | ||
uniform mat4 transform; | ||
in vec3 vPos; | ||
|
||
void main(){ | ||
gl_Position = transform * rotation * vec4(vPos, 1.0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters