From c080e6ad3dac95310b6db1d2df2a8a728e5ede1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Sun, 26 Mar 2023 21:55:01 +0200 Subject: [PATCH] do not use depth in 2d --- crates/bevy_gizmos/src/lines.wgsl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/bevy_gizmos/src/lines.wgsl b/crates/bevy_gizmos/src/lines.wgsl index 9fa8244f178e7..b616476796e06 100644 --- a/crates/bevy_gizmos/src/lines.wgsl +++ b/crates/bevy_gizmos/src/lines.wgsl @@ -15,7 +15,9 @@ struct VertexOutput { } struct FragmentOutput { +#ifdef GIZMO_LINES_3D @builtin(frag_depth) depth: f32, +#endif @location(0) color: vec4, } @@ -33,10 +35,12 @@ fn vertex(in: VertexInput) -> VertexOutput { fn fragment(in: VertexOutput) -> FragmentOutput { var out: FragmentOutput; +#ifdef GIZMO_LINES_3D #ifdef DEPTH_TEST out.depth = in.pos.z; #else out.depth = 1.0; +#endif #endif out.color = in.color;