Skip to content

Commit

Permalink
Fix spot light shadow map
Browse files Browse the repository at this point in the history
  • Loading branch information
asny committed Nov 22, 2024
1 parent 6017366 commit 436536d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/renderer/light/spot_light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl SpotLight {
geometries: impl IntoIterator<Item = impl Geometry> + Clone,
) {
let position = self.position;
let direction = self.direction;
let target = position + self.direction.normalize();
let up = compute_up_direction(self.direction);

let viewport = Viewport::new_at_origo(texture_size, texture_size);
Expand All @@ -86,7 +86,7 @@ impl SpotLight {
let shadow_camera = Camera::new_perspective(
viewport,
position,
position + direction,
target,
up,
self.cutoff,
z_near.max(0.01),
Expand Down

0 comments on commit 436536d

Please sign in to comment.