bevy/crates
Carter Anderson f28b921209 Add "depth_load_op" configuration to 3d Cameras (#4904)
# Objective

Users should be able to configure depth load operations on cameras. Currently every camera clears depth when it is rendered. But sometimes later passes need to rely on depth from previous passes.

## Solution

This adds the `Camera3d::depth_load_op` field with a new `Camera3dDepthLoadOp` value. This is a custom type because Camera3d uses "reverse-z depth" and this helps us record and document that in a discoverable way. It also gives us more control over reflection + other trait impls, whereas `LoadOp` is owned by the `wgpu` crate.

```rust
commands.spawn_bundle(Camera3dBundle {
    camera_3d: Camera3d {
        depth_load_op: Camera3dDepthLoadOp::Load,
        ..default()
    },
    ..default()
});
```

### two_passes example with the "second pass" camera configured to the default (clear depth to 0.0)

![image](https://user-images.githubusercontent.com/2694663/171743172-46d4fdd5-5090-46ea-abe4-1fbc519f6ee8.png)


### two_passes example with the "second pass" camera configured to "load" the depth
![image](https://user-images.githubusercontent.com/2694663/171743323-74dd9a1d-9c25-4883-98dd-38ca0bed8c17.png)

---

## Changelog

### Added

* `Camera3d` now has a `depth_load_op` field, which can configure the Camera's main 3d pass depth loading behavior.
2022-06-07 22:22:10 +00:00
..
bevy_animation Clippy improvements (#4665) 2022-05-31 01:38:07 +00:00
bevy_app run examples in wasm in CI (#4818) 2022-06-06 20:22:51 +00:00
bevy_asset Revert ndk-glue to 0.5 to synchronize with winit (#4916) 2022-06-04 14:30:44 +00:00
bevy_audio Clippy improvements (#4665) 2022-05-31 01:38:07 +00:00
bevy_core Move primitive type registration into bevy_reflect (#4844) 2022-06-03 20:28:44 +00:00
bevy_core_pipeline Add "depth_load_op" configuration to 3d Cameras (#4904) 2022-06-07 22:22:10 +00:00
bevy_derive Decouple some dependencies (#3886) 2022-04-27 19:08:11 +00:00
bevy_diagnostic Split time functionality into bevy_time (#4187) 2022-05-26 00:27:18 +00:00
bevy_dylib Bump Bevy to 0.8.0-dev (#4505) 2022-04-17 23:04:52 +00:00
bevy_dynamic_plugin Bump Bevy to 0.8.0-dev (#4505) 2022-04-17 23:04:52 +00:00
bevy_ecs Add methods for querying lists of entities. (#4879) 2022-06-06 16:09:16 +00:00
bevy_ecs_compile_fail_tests Add methods for querying lists of entities. (#4879) 2022-06-06 16:09:16 +00:00
bevy_encase_derive Migrate to encase from crevice (#4339) 2022-05-18 21:09:21 +00:00
bevy_gilrs Update gilrs to v0.9 (#4848) 2022-05-30 17:26:23 +00:00
bevy_gltf Camera Driven Rendering (#4745) 2022-06-02 00:12:17 +00:00
bevy_hierarchy Add methods for querying lists of entities. (#4879) 2022-06-06 16:09:16 +00:00
bevy_input Update keyboard.rs docs in bevy_input (#4517) 2022-05-17 04:16:54 +00:00
bevy_internal Revert ndk-glue to 0.5 to synchronize with winit (#4916) 2022-06-04 14:30:44 +00:00
bevy_log Update tracing-tracy requirement from 0.8.0 to 0.9.0 (#4786) 2022-05-27 11:54:57 +00:00
bevy_macro_utils bevy_reflect_derive: Tidying up the code (#4712) 2022-05-12 19:43:23 +00:00
bevy_math Document bevy_math (#4591) 2022-04-26 18:23:29 +00:00
bevy_mikktspace Generate vertex tangents using mikktspace (#3872) 2022-05-31 22:53:54 +00:00
bevy_pbr add NO_STORAGE_BUFFERS_SUPPORT shaderdef when needed (#4949) 2022-06-06 20:00:30 +00:00
bevy_ptr Clippy improvements (#4665) 2022-05-31 01:38:07 +00:00
bevy_reflect Move primitive type registration into bevy_reflect (#4844) 2022-06-03 20:28:44 +00:00
bevy_render Refactor Camera methods and add viewport rect (#4948) 2022-06-07 15:23:45 +00:00
bevy_scene Update gilrs to v0.9 (#4848) 2022-05-30 17:26:23 +00:00
bevy_sprite Camera Driven Rendering (#4745) 2022-06-02 00:12:17 +00:00
bevy_tasks Remove unused CountdownEvent (#4290) 2022-04-26 21:20:12 +00:00
bevy_text Camera Driven Rendering (#4745) 2022-06-02 00:12:17 +00:00
bevy_time Split time functionality into bevy_time (#4187) 2022-05-26 00:27:18 +00:00
bevy_transform Nightly clippy fixes (#3491) 2022-05-17 04:38:03 +00:00
bevy_ui Camera Driven Viewports (#4898) 2022-06-05 00:27:49 +00:00
bevy_utils Update gilrs to v0.9 (#4848) 2022-05-30 17:26:23 +00:00
bevy_window Camera Driven Rendering (#4745) 2022-06-02 00:12:17 +00:00
bevy_winit Fix crash when using Duration::MAX (#4900) 2022-06-02 19:42:20 +00:00