Skip to content

Commit

Permalink
Fix for directional lighting
Browse files Browse the repository at this point in the history
Directional lights in plasma are a global light vector. The lighting
algorithm expects the vector to the light, so the global light vector
needs to be reversed for accurate lighting.
  • Loading branch information
colincornaby authored and dpogue committed Sep 11, 2022
1 parent 0d27390 commit 3bb847c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void main() {
if (uLampSources[i].position.w == 0.0) {
// Directional Light with no attenuation
direction = normalize(uLampSources[i].direction);
direction = -uLampSources[i].direction;
attenuation = 1.0;
} else {
// Omni Light in all directions
Expand Down

0 comments on commit 3bb847c

Please sign in to comment.