Move vertex position function into own file

This commit is contained in:
Jim Eckerlein 2023-09-24 15:19:07 +02:00
parent bcc55e6036
commit e197abe0aa
4 changed files with 13 additions and 8 deletions

View file

@ -0,0 +1,7 @@
// Compute the normalized quad coordinates based on the vertex index.
fn vertex_position(vertex_index: u32) -> vec2<f32> {
// #: 0 1 2 3 4 5
// x: 1 1 0 0 0 1
// y: 1 0 0 0 1 1
return vec2<f32>((vec2(1u, 2u) + vertex_index) % 6u < 3u);
}