diff --git a/src/shader.wgsl b/src/shader.wgsl index 41c0e59..c44f459 100644 --- a/src/shader.wgsl +++ b/src/shader.wgsl @@ -47,8 +47,8 @@ struct GroundOutput { @vertex fn vs_ground(@builtin(vertex_index) vertex_index: u32) -> GroundOutput { // hacky way to draw two triangles that make a square - let tmp1 = (i32(vertex_index)-i32(vertex_index)/3*2) / 2; - let tmp2 = (i32(vertex_index)-i32(vertex_index)/3*2) & 1; + let tmp1 = i32(vertex_index)/2-i32(vertex_index)/3; + let tmp2 = i32(vertex_index)&1; let pos = vec3( f32(tmp1) * 2.0 - 1.0, 0.0,