#ifdef GIZMO_LINES_3D #import bevy_pbr::mesh_view_bindings #else #import bevy_sprite::mesh2d_view_bindings #endif struct VertexInput { @location(0) pos: vec3, @location(1) color: vec4, } struct VertexOutput { @builtin(position) pos: vec4, @location(0) color: vec4, } struct FragmentOutput { @builtin(frag_depth) depth: f32, @location(0) color: vec4, } @vertex fn vertex(in: VertexInput) -> VertexOutput { var out: VertexOutput; out.pos = view.view_proj * vec4(in.pos, 1.0); out.color = in.color; return out; } @fragment fn fragment(in: VertexOutput) -> FragmentOutput { var out: FragmentOutput; #ifdef DEPTH_TEST out.depth = in.pos.z; #else out.depth = 1.0; #endif out.color = in.color; return out; }