diff options
Diffstat (limited to 'shaders')
| -rw-r--r-- | shaders/sprite.wgsl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/shaders/sprite.wgsl b/shaders/sprite.wgsl new file mode 100644 index 0000000..7d2c5ce --- /dev/null +++ b/shaders/sprite.wgsl @@ -0,0 +1,18 @@ + +struct VertexOutput { + @builtin(position) clip_position: vec4<f32> +} + +@vertex +fn vs_main(@builtin(vertex_index) in_vertex_index: u32) -> VertexOutput { + var out: VertexOutput; + let x = (1.0 * f32(in_vertex_index % u32(2))) + -0.5; + let y = (1.0 * f32(in_vertex_index / u32(2))) + -0.5; + out.clip_position = vec4<f32>(x, y, 0.0, 1.0); + return out; +} + +@fragment +fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> { + return vec4<f32>(1.0, 1.0, 1.0, 0.0); +}
\ No newline at end of file |
