Skip to content

Commit

Permalink
Implement Point Light Shadows (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
datacrystals committed Jun 21, 2022
1 parent 8bf3742 commit 941a0e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/EditorAssets/Projects/DefaultProject/10041.ERS
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ float ShadowCalculation(STRUCT_PointLight Light)
vec3 fragToLight = Object.FragPos - Light.Position;

// ise the fragment to light vector to sample from the depth map
float closestDepth = texture(DepthMapCubeArray, vec4(fragToLight, 0)).r;
float closestDepth = texture(DepthMapCubeArray, vec4(fragToLight, Light.DepthCubemapIndex)).r;
// it is currently in linear range between [0,1], let's re-transform it back to original depth value
closestDepth *= Light.MaxDistance;
// now get current linear depth as the length between the fragment and light position
Expand Down Expand Up @@ -617,5 +617,6 @@ void main() {






0 comments on commit 941a0e2

Please sign in to comment.