depth prepass stuff not being imported #13657
Answered
by
bugsweeper
bananaturtlesandwich
asked this question in
Q&A
-
hi just trying to see if i can get some materials which use depth prepass working and looked at the example for reference #import bevy_pbr::mesh_types
#import bevy_pbr::mesh_view_bindings
#import bevy_pbr::prepass_utils
@fragment
fn fragment(
@builtin(position) frag_coord: vec4<f32>,
@builtin(sample_index) sample_index: u32,
#import bevy_pbr::mesh_vertex_output
) -> @location(0) vec4<f32> {
let depth = prepass_depth(frag_coord, sample_index);
return vec4(depth, depth, depth, 1.0);
} but i'm getting this
any ideas on what i might be doing wrong? |
Beta Was this translation helpful? Give feedback.
Answered by
bugsweeper
Jun 5, 2024
Replies: 1 comment 6 replies
-
Can you share a minimal reproduction. The prepass_depth function is only gated on the prepass being enabled, but you said you already added the DepthPrepass component to your camera so something else is missing but it's hard to know without more code. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you look in ssr.wgsl, there is prepass_utils imported from bevy_pbr like in your example, and in other place prepass_utils::prepass_depth is used instead of just
prepass_depth
in your example. Can you try importbevy_pbr::prepass_utils::prepass_depth
or useprepass_utils::prepass_depth
?