bevy_pbr2: pbr.wgsl: Fix the orthographic projection check (#17)

This commit is contained in:
Robert Swain 2021-07-02 01:12:35 +02:00 committed by Carter Anderson
parent e1e4055a51
commit a9937190cd

View file

@ -427,7 +427,7 @@ fn fragment(in: FragmentInput) -> [[location(0)]] vec4<f32> {
// # endif
var V: vec3<f32>;
if (view.view_proj.z.z != 1.0) { // If the projection is not orthographic
if (view.view_proj.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 {