struct LookParams { m: mat4x4f, } struct Vertex { @location(0) position: vec3f, @location(1) normal: vec3f, } struct Varying { @builtin(position) screen: vec4f, @location(0) normal: vec3f, } @group(0) @binding(0) var look: LookParams; @vertex fn on_vertex(in: Vertex) -> Varying { let pos = look.m * vec4f(in.position, 1.0); let normal = in.normal; return Varying(pos, normal); } @fragment fn on_fragment(in: Varying) -> @location(0) vec4f { return vec4f(0.5 + 0.5 * in.normal, 1.0); }