Skip to content

Commit

Permalink
Implement Spot Light Shadows (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
datacrystals committed Jun 12, 2022
1 parent 2927453 commit 853f309
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/EditorAssets/Projects/DefaultProject/10041.ERS
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,8 @@ vec3 PBRSpotLight(STRUCT_SpotLight Light, vec3 ViewDir, vec3 Reflectance, STRUCT

// Calculate Spot Intensity
float Theta = dot(normalize(Light.Position - Object.FragPos), normalize(-Light.Direction));
float Epsilon = Light.CutOff - Light.OuterCutOff;
float Intensity = clamp((Theta - Light.OuterCutOff) / Epsilon, 0.0f, 1.0f);
float Epsilon = Light.OuterCutOff;
float Intensity = clamp((Theta - Light.CutOff) / Epsilon, 0.0f, 1.0f);

if (GammaCorrectionEnabled_) {
Intensity = pow(Intensity, Gamma_*Gamma_);
Expand Down Expand Up @@ -615,3 +615,4 @@ void main() {




0 comments on commit 853f309

Please sign in to comment.