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_mod_outline::common::VertexOutput
3struct FragmentOutput {
4 @location(0) colour: vec4<f32>,
5#ifdef FLAT_DEPTH
6#ifndef FLOOD_INIT
7 @builtin(frag_depth) frag_depth: f32,
8#endif
9#endif
10};
12#ifdef ALPHA_MASK_TEXTURE
13@group(3) @binding(0) var alpha_mask_texture: texture_2d<f32>;
14@group(3) @binding(1) var alpha_mask_sampler: sampler;
15#endif
17@fragment
18fn fragment(vertex: VertexOutput) -> FragmentOutput {
19 var out: FragmentOutput;
21#ifdef ALPHA_MASK_TEXTURE
22 let alpha_mask = textureSample(alpha_mask_texture, alpha_mask_sampler, vertex.uv)[#{ALPHA_MASK_CHANNEL}];
23 if (alpha_mask < vertex.alpha_mask_threshold) {
24 discard;
25 }
26#endif
28#ifdef FLAT_DEPTH
29#ifndef FLOOD_INIT
30 out.frag_depth = vertex.flat_depth;
31#endif
32#endif
33#ifdef VOLUME
34 out.colour = vertex.volume_colour;
35#endif
36#ifdef FLOOD_INIT
37 out.colour = vec4<f32>(vertex.position.xy, vertex.flat_depth, 0.0);
38#endif
39 return out;
Contents