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;