Skip to content

Commit

Permalink
Use TBN in apply_normal_mapping in pbr_prepass (#13716)
Browse files Browse the repository at this point in the history
# Objective

- apply_normal_mapping was changed to use TBN but the pbr_prepass was
not updated for that change

## Solution

- Update the pbr_prepass to correctly apply normal mapping
  • Loading branch information
IceSentry authored Jun 6, 2024
1 parent 175e146 commit f7ae277
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_pbr/src/render/pbr_prepass.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ fn fragment(
uv,
bias,
).rgb;
let TBN = pbr_functions::calculate_tbn_mikktspace(normal, in.world_tangent);

normal = pbr_functions::apply_normal_mapping(
material.flags,
world_normal,
TBN,
double_sided,
is_front,
in.world_tangent,
Nt,
view.mip_bias,
);
Expand Down

0 comments on commit f7ae277

Please sign in to comment.