examples: add ported two-cubes example (#228)
This commit is contained in:
parent
f96bbb453e
commit
3fb59a1e34
6 changed files with 324 additions and 0 deletions
17
examples/two-cubes/vert.wgsl
Executable file
17
examples/two-cubes/vert.wgsl
Executable 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue