// Lines: gizmos, and anything else drawn to be understood rather than looked
// at. No lighting — a wire is its own colour, and shading it would only make
// it harder to see.
struct Camera {
view_proj: mat4x4<f32>,
};
@group(0) @binding(0)
var<uniform> camera: Camera;
struct VertexInput {
@location(0) position: vec3<f32>,
@location(1) color: vec4<f32>,
};
struct VertexOutput {
@builtin(position) clip_position: vec4<f32>,
@location(0) color: vec4<f32>,
};
@vertex
fn vs_main(vertex: VertexInput) -> VertexOutput {
var out: VertexOutput;
out.clip_position = camera.view_proj * vec4<f32>(vertex.position, 1.0);
out.color = vertex.color;
return out;
}
@fragment
fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
return in.color;
}