Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/bevy_light/src/cascade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ pub fn build_directional_light_cascades(
// users to not change any other aspects of the transform - there's no guarantee
// `transform.to_matrix()` will give us a matrix with our desired properties.
// Instead, we directly create a good matrix from just the rotation.
let world_from_light = Mat4::from_quat(transform.compute_transform().rotation);
let light_to_world_inverse = world_from_light.inverse();
let world_from_light = Mat4::from_quat(transform.rotation());
let light_to_world_inverse = world_from_light.transpose();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this now be light_to_world_transpose? Do you think a comment should be here explaining why this is still valid?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be light_from_world tbh

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm yeah good point

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

theres a few other inconsistencies in the file, i'd rather leave them to a follow up so as to not merge conflict myself. variable renames are trivial, im mostly interested in getting the precision improvements in atm


for (view_entity, projection, view_to_world) in views.iter().copied() {
let camera_to_light_view = light_to_world_inverse * view_to_world;
Expand Down
Loading