Improve drawing

This commit is contained in:
Andras Schmelczer 2023-04-27 20:55:48 +01:00
commit de7fcc15d0
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
6 changed files with 221 additions and 56 deletions

View file

@ -0,0 +1,23 @@
struct VertexOutput {
@builtin(position) position : vec4<f32>,
@location(0) uv : vec2<f32>
}
@vertex
fn vertex(
@location(0) uv : vec2<f32>
) -> VertexOutput {
let position = uv * 2.0 - 1.0;
return VertexOutput(vec4(position, 0.0, 1.0), uv);
}
struct Settings {
size : vec2<f32>
};
@group(0) @binding(0) var<uniform> settings : Settings;
@fragment
fn fragment(@location(0) uv: vec2<f32>) -> @location(0) vec4<f32> {
return vec4(1, settings.size.x * 0, 0, 1);
}