Replies: 1 comment 1 reply
-
This is probably partially because 3d renders after 2d in 0.6: https://github.com/bevyengine/bevy/blob/main/crates/bevy_core_pipeline/src/main_pass_driver.rs However switching the order does not resolve the issue: impl Node for MainPassDriverNode {
fn run(
&self,
graph: &mut RenderGraphContext,
_render_context: &mut RenderContext,
world: &World,
) -> Result<(), NodeRunError> {
let extracted_cameras = world.get_resource::<ExtractedCameraNames>().unwrap();
if let Some(camera_3d) = extracted_cameras.entities.get(CameraPlugin::CAMERA_3D) {
graph.run_sub_graph(
crate::draw_3d_graph::NAME,
vec![SlotValue::Entity(*camera_3d)],
)?;
}
if let Some(camera_2d) = extracted_cameras.entities.get(CameraPlugin::CAMERA_2D) {
graph.run_sub_graph(
crate::draw_2d_graph::NAME,
vec![SlotValue::Entity(*camera_2d)],
)?;
}
Ok(())
}
} We should definitely do that, as 2d-on-top-of-3d is a way more common scenario. But this will require some investigation to resolve. I'm converting this discussion to an issue so we can track it better. Thanks for the report! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone! I'm trying to migrate my game from Bevy 0.5 to 0.6. The core of my game takes place in 2D, but I had a 3D background that gave my game a distinctive look. In Bevy 0.5 I was using a perspective camera and didn't have any issues rendering the 2D sprites and the background 3D models. Below is the Bevy 0.5 code for the perspective camera I was using.
Snapshot of game from Bevy 0.5:

Since migrating to 0.6. I haven't been able to setup the camera in a way that lets me view the background 3D models and the sprites. Below is the perspective camera code I was using in Bevy 0.6 after I initially migrated (same as before).
The image below is the game in Bevy 0.6. 3D models are visible but sprites are not appearing.
The next thing I tried was a 2D orthographic camera using the following code:
Now the 2D sprites are appearing but not the background models.

I was wondering if anyone had insight into how to render both the sprites and the background models like I had from Bevy 0.5 with the perspective camera. I also tried playing around with the other camera properties but didn't have much luck. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions