examples: add ported rotating-cube example (#227)

This commit is contained in:
PiergiorgioZagaria 2022-04-17 22:50:25 +02:00 committed by GitHub
parent 93629022c5
commit f96bbb453e
Failed to generate hash of commit
6 changed files with 322 additions and 13 deletions

View file

@ -0,0 +1,17 @@
@group(0) @binding(0) var<uniform> ubo : mat4x4<f32>;
struct VertexOut {
@builtin(position) position_clip : vec4<f32>;
@location(0) fragUV : vec2<f32>;
@location(1) fragPosition: vec4<f32>;
}
@stage(vertex) fn main(
@location(0) position : vec4<f32>,
@location(1) uv: vec2<f32>
) -> VertexOut {
var output : VertexOut;
output.position_clip = position * ubo;
output.fragUV = uv;
output.fragPosition = 0.5 * (position + vec4<f32>(1.0, 1.0, 1.0, 1.0));
return output;
}