examples: added fractal-cube example

This commit is contained in:
PiergiorgioZagaria 2022-04-24 20:08:45 +02:00 committed by Stephen Gutekanst
parent d0d0db8725
commit d6dad96059
6 changed files with 477 additions and 0 deletions

22
examples/fractal-cube/vert.wgsl Executable file
View file

@ -0,0 +1,22 @@
struct Uniforms {
matrix : mat4x4<f32>,
};
@binding(0) @group(0) var<uniform> ubo : Uniforms;
struct VertexOut {
@builtin(position) Position : 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 = position * ubo.matrix;
output.fragUV = uv;
output.fragPosition = 0.5 * (position + vec4<f32>(1.0, 1.0, 1.0, 1.0));
return output;
}