diff --git a/crates/bevy_pbr/src/render/utils.wgsl b/crates/bevy_pbr/src/render/utils.wgsl index fb3ef2d1f1b321..8a5b58c5d0c980 100644 --- a/crates/bevy_pbr/src/render/utils.wgsl +++ b/crates/bevy_pbr/src/render/utils.wgsl @@ -34,7 +34,7 @@ fn coords_to_viewport_uv(position: vec2, viewport: vec4) -> vec2 // For encoding normals or unit direction vectors as octahedral coordinates. fn octahedral_encode(v: vec3) -> vec2 { var n = v / (abs(v.x) + abs(v.y) + abs(v.z)); - let octahedral_wrap = (1.0 - abs(n.yx)) * select(vec2(-1.0), vec2(1.0), n.xy > 0.0); + let octahedral_wrap = (1.0 - abs(n.yx)) * select(vec2(-1.0), vec2(1.0), n.xy > vec2f(0.0)); let n_xy = select(octahedral_wrap, n.xy, n.z >= 0.0); return n_xy * 0.5 + 0.5; }