bevy/crates/bevy_core_pipeline/src
Aevyrie bed9ddf3ce
Refactor and simplify custom projections (#17063)
# Objective

- Fixes https://github.com/bevyengine/bevy/issues/16556
- Closes https://github.com/bevyengine/bevy/issues/11807

## Solution

- Simplify custom projections by using a single source of truth -
`Projection`, removing all existing generic systems and types.
- Existing perspective and orthographic structs are no longer components
- I could dissolve these to simplify further, but keeping them around
was the fast way to implement this.
- Instead of generics, introduce a third variant, with a trait object.
- Do an object safety dance with an intermediate trait to allow cloning
boxed camera projections. This is a normal rust polymorphism papercut.
You can do this with a crate but a manual impl is short and sweet.

## Testing

- Added a custom projection example

---

## Showcase

- Custom projections and projection handling has been simplified.
- Projection systems are no longer generic, with the potential for many
different projection components on the same camera.
- Instead `Projection` is now the single source of truth for camera
projections, and is the only projection component.
- Custom projections are still supported, and can be constructed with
`Projection::custom()`.

## Migration Guide

- `PerspectiveProjection` and `OrthographicProjection` are no longer
components. Use `Projection` instead.
- Custom projections should no longer be inserted as a component.
Instead, simply set the custom projection as a value of `Projection`
with `Projection::custom()`.
2025-01-01 20:44:24 +00:00
..
auto_exposure Deny derive_more error feature and replace it with thiserror (#16684) 2024-12-06 17:03:55 +00:00
blit Expose Pipeline Compilation Zero Initialize Workgroup Memory Option (#16301) 2024-11-08 21:42:37 +00:00
bloom Expose Pipeline Compilation Zero Initialize Workgroup Memory Option (#16301) 2024-11-08 21:42:37 +00:00
contrast_adaptive_sharpening Fix CAS toggle broken by retained render world (#16533) 2024-11-27 23:38:09 +00:00
core_2d Refactor and simplify custom projections (#17063) 2025-01-01 20:44:24 +00:00
core_3d Implement bindless lightmaps. (#16653) 2024-12-16 23:37:06 +00:00
deferred Get lightmaps working in deferred rendering. (#16836) 2024-12-26 22:13:05 +00:00
dof Don't reëxport bevy_image from bevy_render (#16163) 2024-11-10 06:54:38 +00:00
fullscreen_vertex_shader
fxaa Don't reëxport bevy_image from bevy_render (#16163) 2024-11-10 06:54:38 +00:00
motion_blur Move required components doc to type doc (#16575) 2024-12-03 19:45:20 +00:00
oit Update hashbrown to 0.15 (#15801) 2024-12-10 19:45:50 +00:00
post_process Fix Docs // incorrect default value for ChromaticAberration intensity (#16994) 2024-12-29 19:32:44 +00:00
prepass Update the prepass shaders and fix the batching logic for bindless and multidraw. (#16755) 2024-12-12 04:24:56 +00:00
skybox Don't reëxport bevy_image from bevy_render (#16163) 2024-11-10 06:54:38 +00:00
smaa Fix missing import (#16337) 2024-11-11 18:48:41 +00:00
taa Remove bevy_core (#16897) 2024-12-19 18:36:51 +00:00
tonemapping Don't reëxport bevy_image from bevy_render (#16163) 2024-11-10 06:54:38 +00:00
upscaling Update hashbrown to 0.15 (#15801) 2024-12-10 19:45:50 +00:00
lib.rs Rust 1.83, allow -> expect (missing_docs) (#16561) 2024-12-16 23:27:57 +00:00
msaa_writeback.rs