diff --git a/src/nodes/drawable/line.wgsl b/src/nodes/drawable/line.wgsl index e227143..4094e5c 100644 --- a/src/nodes/drawable/line.wgsl +++ b/src/nodes/drawable/line.wgsl @@ -14,6 +14,9 @@ pbr_functions::{apply_pbr_lighting, main_pass_post_lighting_processing}, } #endif +#ifdef OIT_ENABLED +#import bevy_core_pipeline::oit::oit_draw +#endif struct LineMaterial { unused: u32, @@ -51,5 +54,10 @@ fn fragment( out.color = main_pass_post_lighting_processing(pbr_input, out.color); #endif +#ifdef OIT_ENABLED + oit_draw(in.position, out.color, false); + discard; +#else return out; +#endif } diff --git a/src/nodes/drawable/lines.rs b/src/nodes/drawable/lines.rs index 7a1555a..6bc4bfe 100644 --- a/src/nodes/drawable/lines.rs +++ b/src/nodes/drawable/lines.rs @@ -49,7 +49,7 @@ impl MaterialExtension for LineExtension { } fn alpha_mode() -> Option { - Some(AlphaMode::Opaque) + Some(AlphaMode::Blend) } }