bevy/examples/3d
Jakob Hellermann bf6de89622 use marker components for cameras instead of name strings (#3635)
**Problem**
- whenever you want more than one of the builtin cameras (for example multiple windows, split screen, portals), you need to add a render graph node that executes the correct sub graph, extract the camera into the render world and add the correct `RenderPhase<T>` components
- querying for the 3d camera is annoying because you need to compare the camera's name to e.g. `CameraPlugin::CAMERA_3d`

**Solution**
- Introduce the marker types `Camera3d`, `Camera2d` and `CameraUi`
-> `Query<&mut Transform, With<Camera3d>>` works
- `PerspectiveCameraBundle::new_3d()` and `PerspectiveCameraBundle::<Camera3d>::default()` contain the `Camera3d` marker
- `OrthographicCameraBundle::new_3d()` has `Camera3d`, `OrthographicCameraBundle::new_2d()` has `Camera2d`
- remove `ActiveCameras`, `ExtractedCameraNames`
- run 2d, 3d and ui passes for every camera of their respective marker
-> no custom setup for multiple windows example needed

**Open questions**
- do we need a replacement for `ActiveCameras`? What about a component `ActiveCamera { is_active: bool }` similar to `Visibility`?

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2022-03-12 00:41:06 +00:00
..
3d_scene.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
lighting.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
load_gltf.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
many_cubes.rs many_cubes: Add a cube pattern suitable for benchmarking culling changes (#4126) 2022-03-08 04:39:52 +00:00
msaa.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
orthographic.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
parenting.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
pbr.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
render_to_texture.rs use marker components for cameras instead of name strings (#3635) 2022-03-12 00:41:06 +00:00
shadow_biases.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
shadow_caster_receiver.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
spherical_area_lights.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
texture.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
update_gltf_scene.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
wireframe.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00