Skip to content

Commit

Permalink
Merge pull request #488 from andreasplesch/patch-1
Browse files Browse the repository at this point in the history
use spec. for ang. attenuation
  • Loading branch information
jim-ec authored Nov 21, 2023
2 parents 9dafdd4 + c4ab650 commit 14c9818
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/Renderer/shaders/punctual.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ float getSpotAttenuation(vec3 pointToLight, vec3 spotDirection, float outerConeC
{
if (actualCos < innerConeCos)
{
return smoothstep(outerConeCos, innerConeCos, actualCos);
float angularAttenuation = (actualCos - outerConeCos) / (innerConeCos - outerConeCos);
return angularAttenuation * angularAttenuation;
}
return 1.0;
}
Expand Down

0 comments on commit 14c9818

Please sign in to comment.