Skip to content

Commit

Permalink
Add a scene viewer tool (#4183)
Browse files Browse the repository at this point in the history
# Objective

- Allow quick and easy testing of scenes

## Solution

- Add a `scene-viewer` tool based on `load_gltf`.
  - Run it with e.g. `cargo run --release --example scene_viewer --features jpeg -- ../some/path/assets/models/Sponza/glTF/Sponza.gltf#Scene0`
- Configure the asset path as pointing to the repo root for convenience (paths specified relative to current working directory)
- Copy over the camera controller from the `shadow_biases` example
- Support toggling the light animation
- Support toggling shadows
- Support adjusting the directional light shadow projection (cascaded shadow maps will remove the need for this later)

I don't want to do too much on it up-front. Rather we can add features over time as we need them.
  • Loading branch information
superdump committed Mar 19, 2022
1 parent fee7a26 commit 738cd5e
Show file tree
Hide file tree
Showing 3 changed files with 416 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,10 @@ path = "examples/shader/compute_shader_game_of_life.rs"
name = "bevymark"
path = "examples/tools/bevymark.rs"

[[example]]
name = "scene_viewer"
path = "examples/tools/scene_viewer.rs"

# Transforms
[[example]]
name = "global_vs_local_translation"
Expand Down
1 change: 1 addition & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ Example | File | Description
Example | File | Description
--- | --- | ---
`bevymark` | [`tools/bevymark.rs`](./tools/bevymark.rs) | A heavy sprite rendering workload to benchmark your system with Bevy
`scene_viewer` | [`tools/scene_viewer.rs`](./tools/scene_viewer.rs) | A simple way to view glTF models with Bevy. Just run `cargo run --release --example scene_viewer -- /path/to/model.gltf#Scene0`, replacing the path as appropriate. With no arguments it will load the FieldHelmet glTF model from the repository assets subdirectory.

## Transforms

Expand Down
Loading

0 comments on commit 738cd5e

Please sign in to comment.