diff --git a/.gitignore b/.gitignore index 4f3c92fcf..f8f0ed551 100644 --- a/.gitignore +++ b/.gitignore @@ -12,8 +12,9 @@ Cargo.lock # Other .DS_Store -# VSCode project +# IDE/Editor configuration files .vscode +.idea # Output from capture example red.png diff --git a/wgpu/examples/boids/README.md b/wgpu/examples/boids/README.md new file mode 100644 index 000000000..28c7c88bb --- /dev/null +++ b/wgpu/examples/boids/README.md @@ -0,0 +1,13 @@ +# boids + +Flocking boids example with gpu compute update pass + +## To Run + +``` +cargo run --example boids +``` + +## Screenshots + +![Boids example](./screenshot.png) diff --git a/wgpu/examples/boids/screenshot.png b/wgpu/examples/boids/screenshot.png new file mode 100644 index 000000000..e510c1c16 Binary files /dev/null and b/wgpu/examples/boids/screenshot.png differ diff --git a/wgpu/examples/capture/README.md b/wgpu/examples/capture/README.md new file mode 100644 index 000000000..b9c0ee22b --- /dev/null +++ b/wgpu/examples/capture/README.md @@ -0,0 +1,18 @@ +# capture + +This example shows how to capture an image by rendering it to a texture, copying the texture to +a buffer, and retrieving it from the buffer. + +This could be used for "taking a screenshot," with the added benefit that this method doesn't +require a window to be created. + +## To Run + +``` +cargo run --example capture +open examples/capture/red.png +``` + +## Screenshots + +![Capture example](./screenshot.png) diff --git a/wgpu/examples/capture/screenshot.png b/wgpu/examples/capture/screenshot.png new file mode 100644 index 000000000..8b57f7e2d Binary files /dev/null and b/wgpu/examples/capture/screenshot.png differ diff --git a/wgpu/examples/cube/README.md b/wgpu/examples/cube/README.md new file mode 100644 index 000000000..8b3f32872 --- /dev/null +++ b/wgpu/examples/cube/README.md @@ -0,0 +1,13 @@ +# cube + +This example renders a textured cube. + +## To Run + +``` +cargo run --example cube +``` + +## Screenshots + +![Cube example](./screenshot.png) diff --git a/wgpu/examples/cube/screenshot.png b/wgpu/examples/cube/screenshot.png new file mode 100644 index 000000000..784ffc463 Binary files /dev/null and b/wgpu/examples/cube/screenshot.png differ diff --git a/wgpu/examples/describe/README.md b/wgpu/examples/describe/README.md new file mode 100644 index 000000000..5a45d7ad6 --- /dev/null +++ b/wgpu/examples/describe/README.md @@ -0,0 +1,16 @@ +# describe + +This example prints output describing the adapter in use. + +## To Run + +``` +cargo run --example describe +``` + +## Example output + +``` +# You might see different output as it depends on your graphics card +AdapterInfo { name: "Intel(R) UHD Graphics 630", vendor: 0, device: 0, device_type: IntegratedGpu, backend: Metal } +``` diff --git a/wgpu/examples/hello-compute/README.md b/wgpu/examples/hello-compute/README.md new file mode 100644 index 000000000..93eaa4b8c --- /dev/null +++ b/wgpu/examples/hello-compute/README.md @@ -0,0 +1,22 @@ +# hello-compute + +Runs a compute shader to determine the number of iterations of the rules from +Collatz Conjecture + +- If n is even, n = n/2 +- If n is odd, n = 3n+1 + +that it will take to finish and reach the number `1`. + +## To Run + +``` +# Pass in any 4 numbers as arguments +RUST_LOG=hello_compute cargo run --example hello-compute 1 4 3 295 +``` + +## Example Output + +``` +[2020-04-25T11:15:33Z INFO hello_compute] Times: [0, 2, 7, 55] +``` diff --git a/wgpu/examples/hello-triangle/README.md b/wgpu/examples/hello-triangle/README.md new file mode 100644 index 000000000..f53af111a --- /dev/null +++ b/wgpu/examples/hello-triangle/README.md @@ -0,0 +1,13 @@ +# hello-triangle + +This example renders a triangle to a window. + +## To Run + +``` +cargo run --example hello-triangle +``` + +## Screenshots + +![Triangle window](./screenshot.png) diff --git a/wgpu/examples/hello-triangle/screenshot.png b/wgpu/examples/hello-triangle/screenshot.png new file mode 100644 index 000000000..ae8350b9f Binary files /dev/null and b/wgpu/examples/hello-triangle/screenshot.png differ diff --git a/wgpu/examples/mipmap/README.md b/wgpu/examples/mipmap/README.md new file mode 100644 index 000000000..a50b0ecbf --- /dev/null +++ b/wgpu/examples/mipmap/README.md @@ -0,0 +1,13 @@ +# mipmap + +This example shows how to generate and make use of mipmaps. + +## To Run + +``` +cargo run --example mipmap +``` + +## Screenshots + +![Mip maps](./screenshot.png) diff --git a/wgpu/examples/mipmap/screenshot.png b/wgpu/examples/mipmap/screenshot.png new file mode 100644 index 000000000..977732afe Binary files /dev/null and b/wgpu/examples/mipmap/screenshot.png differ diff --git a/wgpu/examples/msaa-line/README.md b/wgpu/examples/msaa-line/README.md new file mode 100644 index 000000000..031236f9d --- /dev/null +++ b/wgpu/examples/msaa-line/README.md @@ -0,0 +1,13 @@ +# msaa-line + +This example shows how to render lines using MSAA. + +## To Run + +``` +cargo run --example msaa-line +``` + +## Screenshots + +![MSAA line](./screenshot.png) diff --git a/wgpu/examples/msaa-line/screenshot.png b/wgpu/examples/msaa-line/screenshot.png new file mode 100644 index 000000000..9e4208124 Binary files /dev/null and b/wgpu/examples/msaa-line/screenshot.png differ diff --git a/wgpu/examples/shadow/README.md b/wgpu/examples/shadow/README.md new file mode 100644 index 000000000..62bc83eed --- /dev/null +++ b/wgpu/examples/shadow/README.md @@ -0,0 +1,13 @@ +# shadow + +This animated example demonstrates shadow mapping. + +## To Run + +``` +cargo run --example shadow +``` + +## Screenshots + +![Shadow mapping](./screenshot.png) diff --git a/wgpu/examples/shadow/screenshot.png b/wgpu/examples/shadow/screenshot.png new file mode 100644 index 000000000..ae0782378 Binary files /dev/null and b/wgpu/examples/shadow/screenshot.png differ diff --git a/wgpu/examples/skybox/README.md b/wgpu/examples/skybox/README.md new file mode 100644 index 000000000..d21b1568b --- /dev/null +++ b/wgpu/examples/skybox/README.md @@ -0,0 +1,15 @@ +# skybox + +This animated example demonstrates rendering a skybox. + +## To Run + +``` +cargo run --example skybox +``` + +## Screenshots + +![Skybox](./screenshot.png) + +![Skybox 2](./screenshot2.png) diff --git a/wgpu/examples/skybox/screenshot.png b/wgpu/examples/skybox/screenshot.png new file mode 100644 index 000000000..7cd91cfdf Binary files /dev/null and b/wgpu/examples/skybox/screenshot.png differ diff --git a/wgpu/examples/skybox/screenshot2.png b/wgpu/examples/skybox/screenshot2.png new file mode 100644 index 000000000..45e2848ef Binary files /dev/null and b/wgpu/examples/skybox/screenshot2.png differ