vert 0.1.1

The 51th Rust Game Engine, to write the 6th Game in Rust
Documentation
struct Camera {
    view_pos: vec4<f32>,
    view_proj: mat4x4<f32>,
}

@group(0) @binding(0)
var<uniform> camera: Camera;

struct Vertex {
    @location(0) pos: 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: Vertex,
) -> VertexOutput {
    let world_position = vec4<f32>(vertex.pos, 1.0);
    
    var out: VertexOutput;
    out.clip_position = camera.view_proj * world_position;
    out.color = vertex.color;
    return out;
}
 
@fragment
fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
    return in.color;
}