Skip to content

Commit

Permalink
Fix pbr shader breaking on missing UVs (#8412)
Browse files Browse the repository at this point in the history
# Objective

Fix #8409

Since `in` doesn't have a `uv` field when `VERTEX_UVS` is not defined,
it shouldn't be accessed outside of related `#ifdef`s
  • Loading branch information
nicopap committed Apr 17, 2023
1 parent 396c271 commit c488b70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_pbr/src/render/pbr.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ struct FragmentInput {
fn fragment(in: FragmentInput) -> @location(0) vec4<f32> {
let is_orthographic = view.projection[3].w == 1.0;
let V = calculate_view(in.world_position, is_orthographic);
var uv = in.uv;
#ifdef VERTEX_UVS
var uv = in.uv;
#ifdef VERTEX_TANGENTS
if ((material.flags & STANDARD_MATERIAL_FLAGS_DEPTH_MAP_BIT) != 0u) {
let N = in.world_normal;
Expand Down

0 comments on commit c488b70

Please sign in to comment.