bevy_core_pipeline/
lib.rs1#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
2#![forbid(unsafe_code)]
3#![cfg_attr(docsrs, feature(doc_cfg))]
4#![doc(
5 html_logo_url = "https://bevy.org/assets/icon.png",
6 html_favicon_url = "https://bevy.org/assets/icon.png"
7)]
8
9pub mod blit;
10pub mod core_2d;
11pub mod core_3d;
12pub mod deferred;
13pub mod fullscreen_material;
14pub mod mip_generation;
15pub mod oit;
16pub mod prepass;
17pub mod schedule;
18pub mod skybox;
19pub mod tonemapping;
20pub mod upscaling;
21
22use bevy_ecs::schedule::IntoScheduleConfigs;
23pub use bevy_light::Skybox;
24pub use fullscreen_vertex_shader::FullscreenShader;
25pub use schedule::{Core2d, Core2dSystems, Core3d, Core3dSystems};
26
27mod fullscreen_vertex_shader;
28
29use crate::schedule::{
30 camera_driver, handle_uncovered_swap_chains, submit_pending_command_buffers,
31};
32use crate::{
33 blit::BlitPlugin, core_2d::Core2dPlugin, core_3d::Core3dPlugin,
34 deferred::copy_lighting_id::CopyDeferredLightingIdPlugin, mip_generation::MipGenerationPlugin,
35 prepass::BackgroundMotionVectorsPlugin, tonemapping::TonemappingPlugin,
36 upscaling::UpscalingPlugin,
37};
38use bevy_app::{App, Plugin};
39use bevy_render::renderer::{RenderGraph, RenderGraphSystems};
40use bevy_render::RenderApp;
41use bevy_shader::load_shader_library;
42use oit::OrderIndependentTransparencyPlugin;
43
44#[derive(Default)]
45pub struct CorePipelinePlugin;
46
47impl Plugin for CorePipelinePlugin {
48 fn build(&self, app: &mut App) {
49 load_shader_library!(app, "fullscreen_vertex_shader.wesl");
50 load_shader_library!(app, "tonemapping.wesl");
51
52 app.add_plugins((Core2dPlugin, Core3dPlugin, CopyDeferredLightingIdPlugin))
53 .add_plugins((
54 BlitPlugin,
55 TonemappingPlugin,
56 UpscalingPlugin,
57 OrderIndependentTransparencyPlugin,
58 MipGenerationPlugin,
59 BackgroundMotionVectorsPlugin,
60 ));
61 let Some(render_app) = app.get_sub_app_mut(RenderApp) else {
62 return;
63 };
64 render_app.init_resource::<FullscreenShader>().add_systems(
65 RenderGraph,
66 (
67 camera_driver.in_set(RenderGraphSystems::Render),
68 (submit_pending_command_buffers, handle_uncovered_swap_chains)
69 .chain()
70 .in_set(RenderGraphSystems::Submit),
71 ),
72 );
73 }
74}