diff options
Diffstat (limited to 'client/src/shader.wgsl')
-rw-r--r-- | client/src/shader.wgsl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/client/src/shader.wgsl b/client/src/shader.wgsl index 68bd93d..d2b2d9f 100644 --- a/client/src/shader.wgsl +++ b/client/src/shader.wgsl @@ -15,10 +15,14 @@ struct VertexOut { @location(1) uv: vec2<f32>, } +var<push_constant> project: mat4x4<f32>; + @vertex fn vs_main(vi: VertexIn) -> VertexOut { + var clip = project * vec4(vi.x, vi.y, vi.z, -1.); + clip /= clip.w; let vo = VertexOut( - vec4(vi.x * 0.1, vi.y * 0.1, 0., 1.), + clip, vec3(vi.nx, vi.ny, vi.nz), vec2(vi.u, vi.v), ); |