-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - Add a scene viewer tool #4183
Conversation
It would be nice to be able to spawn a useful default camera when there isn't one in the scene. This would be more useful than a movable camera I think For example https://gltf-viewer.donmccurdy.com computes a bounding box, then moves the camera to be sure the box is fully visible |
I think this should be in |
Do you plan to add environments as above gltf-viewer? |
Done. |
It depends heavily on the model. All the interesting parts of Sponza are on the inside and if you can't maneuver around to look at it then you're stuck looking at the outside walls. That said, it may absolutely make for a sensible default position in general and would allow configuring any directional light shadow projection automatically. So I'll do it. :) |
This was very awkward to do. I have to store a EDIT: Updated on top of main with the camera marker changes. There is a known issue currently where the scene does not always display. I don't know why. Sometimes it does, sometimes it doesn't. Weird. |
feb861e
to
9724db1
Compare
Environment maps and other image-based lighting techniques will likely come in the future and then be added to this example tool, yes. I don’t know when though. |
Well, I'm not sure why the gltf scenes sometimes load and sometimes not, but it doesn't look like it's the fault of this example tool to me. :/ bevy_gltf loads all the textures itself within its LoadContext, and I see no errors. Very confusing. |
Help welcome for figuring out the "sometimes doesn't display the model" bug. It seems to be that the |
99c7854
to
634872c
Compare
That wasn't it. Using |
self plug for #2424 to remove the |
Very nice to be able to quickly view any gltf file 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits, but I think this should exist. Seems quite useful, and the code itself may end up being useful to some beginners.
34cc17d
to
12bd35e
Compare
bors r+ |
# 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.
# 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.
# 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.
Objective
Solution
scene-viewer
tool based onload_gltf
.cargo run --release --example scene_viewer --features jpeg -- ../some/path/assets/models/Sponza/glTF/Sponza.gltf#Scene0
shadow_biases
exampleI don't want to do too much on it up-front. Rather we can add features over time as we need them.