summaryrefslogtreecommitdiff
path: root/workspaces/main/shaders/visual_debug.wgsl
blob: 3a382ca8f07475d5266532b9a237d6af7f563cfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
struct GlobalUniforms {
    view_proj: mat4x4f,
    inv_view_proj: mat4x4f,
    camera_pos_time: vec4f,
    params: vec4f,
    resolution: vec2f,
};
@group(0) @binding(0) var<uniform> uniforms : GlobalUniforms;

struct VertexInput {
    @location(0) position : vec3f,
    @location(1) color : vec3f,
}

struct VertexOutput {
    @builtin(position) position : vec4f,
    @location(0) color : vec3f,
}

@vertex
fn vs_main(in : VertexInput) -> VertexOutput {
    var out : VertexOutput;
    out.position = uniforms.view_proj * vec4f(in.position, 1.0);
    out.color = in.color;
    return out;
}

@fragment
fn fs_main(in : VertexOutput) -> @location(0) vec4f {
    return vec4f(in.color, 1.0);
}