-
-
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
multiple_windows does not render in secondary window #4378
Comments
I can reproduce. Interestingly, it seems to arbitrarily select one camera to work; I imagine that there's some hashmap somewhere causing this behaviour. I'm assuming it's a camera issue, since the clear pass is running successfully. |
Yeah, I just noticed the same thing and updated the ticket. 👍 |
the randomness probably comes from bevy/crates/bevy_render/src/camera/camera.rs Lines 270 to 281 in 4480b36
|
Yeah we changed from rendering all cameras of a given type to just the active one (which is why this used to work).
The missing piece here is choosing the "right" way to drive rendering. This is the "camera driven" vs "render target driven" discussion started in #4191. This is next on my todo list, but I've been focused on merging other peoples' work for 0.7 for awhile now. I'm pretty close to being out of that hole though. I think we "need" active cameras with the current paradigm (and RenderTarget driven rendering). There are flavors of camera-driven where we don't (see #4191 for more info), but our current impl isn't that. If we can't merge a full solution before 0.7, I think the move is to re-add the "second window camera type / render graph" pattern to this example, but I really want higher level render targets that "just work" asap. |
Also sorry for the example regression 😄 |
The example was broken in bevyengine#3635 when the `ActiveCamera` logic was introduced, after which there could only be one active `Camera3d` globally. Ideally there could be one `Camera3d` per render target, not globally, but that isn't the case yet. To fix the example, we need to - don't use `Camera3d` twice, add a new `SecondWindowCamera3d` marker - add the `CameraTypePlugin::<SecondWindowCamera3d>` - extract the correct `RenderPhase`s - add a 3d pass driver node for the secondary camera Fixes bevyengine#4378 Co-authored-by: Jakob Hellermann <[email protected]>
The example was broken in bevyengine#3635 when the `ActiveCamera` logic was introduced, after which there could only be one active `Camera3d` globally. Ideally there could be one `Camera3d` per render target, not globally, but that isn't the case yet. To fix the example, we need to - don't use `Camera3d` twice, add a new `SecondWindowCamera3d` marker - add the `CameraTypePlugin::<SecondWindowCamera3d>` - extract the correct `RenderPhase`s - add a 3d pass driver node for the secondary camera Fixes bevyengine#4378 Co-authored-by: Jakob Hellermann <[email protected]>
Bevy version
main
Operating system & version
Win11
What you did
cargo run --example multiple_windows
What you expected to happen
The gltf should render in both windows
What actually happened
The model only shows in one window, but not consistently the same one
Additional information
The text was updated successfully, but these errors were encountered: