fix(lines): working OIT for lines!

Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
Schmarni
2025-09-18 09:40:40 +02:00
parent b4dccf6f89
commit e3a3db246e
2 changed files with 9 additions and 1 deletions

View File

@@ -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
}

View File

@@ -49,7 +49,7 @@ impl MaterialExtension for LineExtension {
}
fn alpha_mode() -> Option<AlphaMode> {
Some(AlphaMode::Opaque)
Some(AlphaMode::Blend)
}
}