We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2074003 commit ff5519dCopy full SHA for ff5519d
crates/bevy_pbr/src/render/utils.wgsl
@@ -34,7 +34,7 @@ fn coords_to_viewport_uv(position: vec2<f32>, viewport: vec4<f32>) -> vec2<f32>
34
// For encoding normals or unit direction vectors as octahedral coordinates.
35
fn octahedral_encode(v: vec3<f32>) -> vec2<f32> {
36
var n = v / (abs(v.x) + abs(v.y) + abs(v.z));
37
- 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));
38
let n_xy = select(octahedral_wrap, n.xy, n.z >= 0.0);
39
return n_xy * 0.5 + 0.5;
40
}
0 commit comments