Add screenshots of examples
When looking into wgpu-rs as a replacement for WebGL I went to the examples directory on GitHub to browse for a bit. I wanted to see some of the examples at a glance without needing to clone the repository. This commit enables that by adding a README to each example with a description of the example and screenshots / example output. In a few cases the description is a bit redundant - but my hope is that in the future we can improve all the READMEs. Being a web API and thus very accessible, WebGPU could end up being many people's first introduction to graphics programming so the lower we make the barrier the better.
No files matched your search
@@ -12,8 +12,9 @@ Cargo.lock
|
||||
# Other
|
||||
.DS_Store
|
||||
|
||||
# VSCode project
|
||||
# IDE/Editor configuration files
|
||||
.vscode
|
||||
.idea
|
||||
|
||||
# Output from capture example
|
||||
red.png
|
||||
@@ -0,0 +1,13 @@
|
||||
# boids
|
||||
|
||||
Flocking boids example with gpu compute update pass
|
||||
|
||||
## To Run
|
||||
|
||||
```
|
||||
cargo run --example boids
|
||||
```
|
||||
|
||||
## Screenshots
|
||||
|
||||

|
||||
|
After Width: | Height: | Size: 158 KiB |
@@ -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
|
||||
|
||||

|
||||
|
After Width: | Height: | Size: 851 B |
@@ -0,0 +1,13 @@
|
||||
# cube
|
||||
|
||||
This example renders a textured cube.
|
||||
|
||||
## To Run
|
||||
|
||||
```
|
||||
cargo run --example cube
|
||||
```
|
||||
|
||||
## Screenshots
|
||||
|
||||

|
||||
|
After Width: | Height: | Size: 393 KiB |
@@ -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 }
|
||||
```
|
||||
@@ -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]
|
||||
```
|
||||
@@ -0,0 +1,13 @@
|
||||
# hello-triangle
|
||||
|
||||
This example renders a triangle to a window.
|
||||
|
||||
## To Run
|
||||
|
||||
```
|
||||
cargo run --example hello-triangle
|
||||
```
|
||||
|
||||
## Screenshots
|
||||
|
||||

|
||||
|
After Width: | Height: | Size: 25 KiB |
@@ -0,0 +1,13 @@
|
||||
# mipmap
|
||||
|
||||
This example shows how to generate and make use of mipmaps.
|
||||
|
||||
## To Run
|
||||
|
||||
```
|
||||
cargo run --example mipmap
|
||||
```
|
||||
|
||||
## Screenshots
|
||||
|
||||

|
||||
|
After Width: | Height: | Size: 1.4 MiB |
@@ -0,0 +1,13 @@
|
||||
# msaa-line
|
||||
|
||||
This example shows how to render lines using MSAA.
|
||||
|
||||
## To Run
|
||||
|
||||
```
|
||||
cargo run --example msaa-line
|
||||
```
|
||||
|
||||
## Screenshots
|
||||
|
||||

|
||||
|
After Width: | Height: | Size: 179 KiB |
@@ -0,0 +1,13 @@
|
||||
# shadow
|
||||
|
||||
This animated example demonstrates shadow mapping.
|
||||
|
||||
## To Run
|
||||
|
||||
```
|
||||
cargo run --example shadow
|
||||
```
|
||||
|
||||
## Screenshots
|
||||
|
||||

|
||||
|
After Width: | Height: | Size: 277 KiB |
@@ -0,0 +1,15 @@
|
||||
# skybox
|
||||
|
||||
This animated example demonstrates rendering a skybox.
|
||||
|
||||
## To Run
|
||||
|
||||
```
|
||||
cargo run --example skybox
|
||||
```
|
||||
|
||||
## Screenshots
|
||||
|
||||

|
||||
|
||||

|
||||
|
After Width: | Height: | Size: 345 KiB |
|
After Width: | Height: | Size: 170 KiB |