Skip to content

Commit

Permalink
[rs] Demonstrate obj loading in the skybox example
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Feb 13, 2021
1 parent 218556c commit 710901b
Show file tree
Hide file tree
Showing 10 changed files with 6,913 additions and 62 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.mtl binary
*.obj binary
7 changes: 4 additions & 3 deletions wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ ddsfile = "0.4"
log = "0.4"
naga = { git = "https://github.com/gfx-rs/naga", tag = "gfx-10", features = ["wgsl-in"] }
noise = "0.7"
obj = "0.10"
png = "0.16"
rand = { version = "0.7.2", features = ["wasm-bindgen"] }
winit = { version = "0.24.0", features = ["web-sys"] }
winit = { version = "0.24", features = ["web-sys"] }

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
async-executor = "1.0"
Expand All @@ -76,8 +77,8 @@ path="examples/hello-compute/main.rs"
test = true

[patch."https://github.com/gfx-rs/wgpu"]
#wgpu-types = { version = "0.6", path = "../wgpu/wgpu-types" }
#wgpu-core = { version = "0.6", path = "../wgpu/wgpu-core" }
#wgpu-types = { path = "../wgpu/wgpu-types" }
#wgpu-core = { path = "../wgpu/wgpu-core" }

[patch."https://github.com/gfx-rs/subscriber"]
#wgpu-subscriber = { version = "0.1", path = "../subscriber" }
Expand Down
10 changes: 6 additions & 4 deletions wgpu/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ All framework-based examples render to the window.
## Feature matrix
| Feature | boids | cube | mipmap | msaa-line | shadow | skybox | texture-arrays | water |
| ---------------------- | ------ | ------ | ------ | --------- | ------ | ------ | -------------- | ------ |
| vertex attributes | :star: | :star: | :star: | :star: | :star: | | :star: | :star: |
| WGSL shaders | :star: | :star: | :star: | :star: | :star: | :star: | | |
| vertex attributes | :star: | :star: | :star: | :star: | :star: | :star: | :star: | :star: |
| instancing | :star: | | | | | | | |
| lines and points | | | | :star: | | | | |
| dynamic buffer offsets | | | | | :star: | | | |
Expand All @@ -26,20 +27,21 @@ All framework-based examples render to the window.
| multisampling | | | | :star: | | | | |
| off-screen rendering | | | | | :star: | | | :star: |
| stencil testing | | | | | | | | |
| depth testing | | | | | :star: | | | :star: |
| depth testing | | | | | :star: | :star: | | :star: |
| depth biasing | | | | | :star: | | | |
| read-only depth | | | | | | | | :star: |
| blending | | :star: | | | | | | :star: |
| render bundles | | | | :star: | | | | :star: |
| compute passes | :star: | | | | | | | |
| optional extensions | | | | | | | :star: | |
| *optional extensions* | | | | | | | :star: | |
| - binding indexing | | | | | | | :star: | |
| - push constants | | | | | | | :star: | |
| - depth clamping | | | | | :star: | | | |
| - compressed textures | | | | | | :star: | | |
| - polygon mode | | :star: | | | | | | |
| - queries | | | :star: | | | | | |
| WGSL shaders | :star: | :star: | :star: | :star: | :star: | :star: | | |
| *integrations* | | | | | | | | |
| - obj loading | | | | | | :star: | | |

## Hacking

Expand Down
5 changes: 2 additions & 3 deletions wgpu/examples/skybox/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# skybox

This animated example demonstrates rendering a skybox.
This animated example demonstrates oading a Wavefront OBJ model, and rendering it with skybox and simple reflections.
It hooks up `winit` mouse controls for camera rotation around the model at the center.

## To Run

Expand All @@ -11,5 +12,3 @@ cargo run --example skybox
## Screenshots

![Skybox](./screenshot.png)

![Skybox 2](./screenshot2.png)
Loading

0 comments on commit 710901b

Please sign in to comment.