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