Skip to content

Commit

Permalink
Multiple canvas example
Browse files Browse the repository at this point in the history
  • Loading branch information
tsherif committed Jan 30, 2024
1 parent e92f1a1 commit 185126d
Show file tree
Hide file tree
Showing 4 changed files with 400 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Small examples WebGPU usage.
- [Triangle](https://tsherif.github.io/webgpu-examples/triangle.html): Creating vertex buffers and drawing a triangle.
- [Cube](https://tsherif.github.io/webgpu-examples/cube.html): Creating a texture from an ImageBitmap, setting up vertex and uniform buffers, and animating a 3D cube.
- [Particles](https://tsherif.github.io/webgpu-examples/particles.html): Simulating gravity on instanced particles using a compute shader.
- [Multiple Canvases](https://tsherif.github.io/webgpu-examples/multi-canvas.html): Rendering to multiple canvases with a single device instance.

Examples currently only run in Chrome without special flags. See the [Implementation Status](https://github.com/gpuweb/gpuweb/wiki/Implementation-Status) page for updates on support.

Expand Down
1 change: 0 additions & 1 deletion cube.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
const viewMatrix = mat4.create();
const modelMatrix = mat4.create();
const viewProjectionMatrix = mat4.create();
const mvpMatrix = mat4.create();
const rotation = [0, 0, 0];

mat4.perspective(projectionMatrix, Math.PI / 2, canvas.width / canvas.height, 0.1, 10.0)
Expand Down
Loading

0 comments on commit 185126d

Please sign in to comment.