Skip to content

Commit

Permalink
bevy_pbr2: Correct detection of an orthographic projection
Browse files Browse the repository at this point in the history
A projection is not orthographic if the view projection matrix bottom-right
element is 1.0, rather if the projection matrix bottom-right value is 1.0.
Now the projection matrix is bound, this fix is possible.
  • Loading branch information
superdump authored and cart committed Aug 25, 2021
1 parent a5489c0 commit 0f7b411
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pipelined/bevy_pbr2/src/render/pbr.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ fn fragment(in: FragmentInput) -> [[location(0)]] vec4<f32> {
// # endif

var V: vec3<f32>;
if (view.view_proj.w.w != 1.0) { // If the projection is not orthographic
if (view.projection.w.w != 1.0) { // If the projection is not orthographic
// Only valid for a perpective projection
V = normalize(view.world_position.xyz - in.world_position.xyz);
} else {
Expand Down

0 comments on commit 0f7b411

Please sign in to comment.