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
2#import bevy_mod_outline::common::OutlineViewUniform
4struct ComposeOutputUniform {
5 @align(16)
6 volume_offset: f32,
7 volume_colour: vec4<f32>,
8}
10@group(0) @binding(0) var screen_texture: texture_2d<f32>;
11@group(0) @binding(1) var texture_sampler: sampler;
12@group(0) @binding(2) var<uniform> view: OutlineViewUniform;
13@group(0) @binding(3) var<uniform> instance: ComposeOutputUniform;
15struct FragmentOutput {
16 @location(0) colour: vec4<f32>,
17 @builtin(frag_depth) frag_depth: f32,
18};
20@fragment
21fn fragment(in: FullscreenVertexOutput) -> FragmentOutput {
22 let tex = textureSample(screen_texture, texture_sampler, in.uv);
23 var out: FragmentOutput;
24 if distance(in.position.xy, tex.xy) <= view.scale_physical_from_logical * instance.volume_offset {
25 out.colour = instance.volume_colour;
26 out.frag_depth = tex.z;
27 }
28 else {
29 discard;
30 }
31 return out;
Contents