Skip to content

Commit 738cd5e

Browse files
committed
Add a scene viewer tool (#4183)
# 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.
1 parent fee7a26 commit 738cd5e

File tree

3 files changed

+416
-0
lines changed

3 files changed

+416
-0
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,10 @@ path = "examples/shader/compute_shader_game_of_life.rs"
507507
name = "bevymark"
508508
path = "examples/tools/bevymark.rs"
509509

510+
[[example]]
511+
name = "scene_viewer"
512+
path = "examples/tools/scene_viewer.rs"
513+
510514
# Transforms
511515
[[example]]
512516
name = "global_vs_local_translation"

examples/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ Example | File | Description
247247
Example | File | Description
248248
--- | --- | ---
249249
`bevymark` | [`tools/bevymark.rs`](./tools/bevymark.rs) | A heavy sprite rendering workload to benchmark your system with Bevy
250+
`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.
250251

251252
## Transforms
252253

0 commit comments

Comments
 (0)