Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.
1#import bevy_core_pipeline::fullscreen_vertex_shader::FullscreenVertexOutput
3@group(0) @binding(0)
4var material_id_texture: texture_2d<u32>;
6struct FragmentOutput {
7 @builtin(frag_depth) frag_depth: f32,
9}
11@fragment
12fn fragment(in: FullscreenVertexOutput) -> FragmentOutput {
13 var out: FragmentOutput;
14 // Depth is stored as unorm, so we are dividing the u8 by 255.0 here.
15 out.frag_depth = f32(textureLoad(material_id_texture, vec2<i32>(in.position.xy), 0).x) / 255.0;
16 return out;
Contents