From 5dcc4be2ceafdccc9ce69765512d19c106ab70f2 Mon Sep 17 00:00:00 2001 From: Nico Zweifel <34443492+NicoZweifel@users.noreply.github.com> Date: Tue, 18 Nov 2025 12:37:25 +0100 Subject: [PATCH 1/2] fix: imports --- crates/bevy_pbr/src/render/pbr.wgsl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/bevy_pbr/src/render/pbr.wgsl b/crates/bevy_pbr/src/render/pbr.wgsl index 0cdf896a00945..22156d926f556 100644 --- a/crates/bevy_pbr/src/render/pbr.wgsl +++ b/crates/bevy_pbr/src/render/pbr.wgsl @@ -5,16 +5,18 @@ decal::clustered::apply_decal_base_color, } +#ifdef VISIBILITY_RANGE_DITHER +#import bevy_pbr::pbr_functions::visibility_range_dither; +#endif + #ifdef PREPASS_PIPELINE #import bevy_pbr::{ prepass_io::{VertexOutput, FragmentOutput}, - pbr_functions, pbr_deferred_functions::deferred_output, } #else #import bevy_pbr::{ forward_io::{VertexOutput, FragmentOutput}, - pbr_functions, pbr_functions::{apply_pbr_lighting, main_pass_post_lighting_processing}, pbr_types::STANDARD_MATERIAL_FLAGS_UNLIT_BIT, } @@ -51,7 +53,7 @@ fn fragment( // If we're in the crossfade section of a visibility range, conditionally // discard the fragment according to the visibility pattern. #ifdef VISIBILITY_RANGE_DITHER - pbr_functions::visibility_range_dither(in.position, in.visibility_range_dither); + visibility_range_dither(in.position, in.visibility_range_dither); #endif #ifdef FORWARD_DECAL From b79dde8675a5722287b61df2decf617ccd9731c7 Mon Sep 17 00:00:00 2001 From: Nico Zweifel <34443492+NicoZweifel@users.noreply.github.com> Date: Tue, 18 Nov 2025 12:49:04 +0100 Subject: [PATCH 2/2] chore: move import down --- crates/bevy_pbr/src/render/pbr.wgsl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/bevy_pbr/src/render/pbr.wgsl b/crates/bevy_pbr/src/render/pbr.wgsl index 22156d926f556..b4e6ca7b1142b 100644 --- a/crates/bevy_pbr/src/render/pbr.wgsl +++ b/crates/bevy_pbr/src/render/pbr.wgsl @@ -5,9 +5,7 @@ decal::clustered::apply_decal_base_color, } -#ifdef VISIBILITY_RANGE_DITHER -#import bevy_pbr::pbr_functions::visibility_range_dither; -#endif + #ifdef PREPASS_PIPELINE #import bevy_pbr::{ @@ -22,6 +20,10 @@ } #endif +#ifdef VISIBILITY_RANGE_DITHER +#import bevy_pbr::pbr_functions::visibility_range_dither; +#endif + #ifdef MESHLET_MESH_MATERIAL_PASS #import bevy_pbr::meshlet_visibility_buffer_resolve::resolve_vertex_output #endif