Skip to content

Commit

Permalink
make deferred rendering work
Browse files Browse the repository at this point in the history
  • Loading branch information
Elabajaba committed Nov 23, 2023
1 parent 665dd8e commit 3c5c538
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_pbr/src/render/utils.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn coords_to_viewport_uv(position: vec2<f32>, viewport: vec4<f32>) -> vec2<f32>
// For encoding normals or unit direction vectors as octahedral coordinates.
fn octahedral_encode(v: vec3<f32>) -> vec2<f32> {
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;
}
Expand Down

0 comments on commit 3c5c538

Please sign in to comment.