bevy_core_pipeline/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// FIXME(15321): solve CI failures, then replace with `#![expect()]`.
#![allow(missing_docs, reason = "Not all docs are written yet, see #3492.")]
#![forbid(unsafe_code)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc(
    html_logo_url = "https://bevyengine.org/assets/icon.png",
    html_favicon_url = "https://bevyengine.org/assets/icon.png"
)]

pub mod auto_exposure;
pub mod blit;
pub mod bloom;
pub mod contrast_adaptive_sharpening;
pub mod core_2d;
pub mod core_3d;
pub mod deferred;
pub mod dof;
pub mod fullscreen_vertex_shader;
pub mod fxaa;
pub mod motion_blur;
pub mod msaa_writeback;
pub mod oit;
pub mod post_process;
pub mod prepass;
mod skybox;
pub mod smaa;
mod taa;
pub mod tonemapping;
pub mod upscaling;

pub use skybox::Skybox;

/// Experimental features that are not yet finished. Please report any issues you encounter!
///
/// Expect bugs, missing features, compatibility issues, low performance, and/or future breaking changes.
pub mod experimental {
    #[expect(deprecated)]
    pub mod taa {
        pub use crate::taa::{
            TemporalAntiAliasBundle, TemporalAntiAliasNode, TemporalAntiAliasPlugin,
            TemporalAntiAliasSettings, TemporalAntiAliasing,
        };
    }
}

/// The core pipeline prelude.
///
/// This includes the most common types in this crate, re-exported for your convenience.
#[expect(deprecated)]
pub mod prelude {
    #[doc(hidden)]
    pub use crate::{
        core_2d::{Camera2d, Camera2dBundle},
        core_3d::{Camera3d, Camera3dBundle},
    };
}

use crate::{
    blit::BlitPlugin,
    bloom::BloomPlugin,
    contrast_adaptive_sharpening::CasPlugin,
    core_2d::Core2dPlugin,
    core_3d::Core3dPlugin,
    deferred::copy_lighting_id::CopyDeferredLightingIdPlugin,
    dof::DepthOfFieldPlugin,
    fullscreen_vertex_shader::FULLSCREEN_SHADER_HANDLE,
    fxaa::FxaaPlugin,
    motion_blur::MotionBlurPlugin,
    msaa_writeback::MsaaWritebackPlugin,
    post_process::PostProcessingPlugin,
    prepass::{DeferredPrepass, DepthPrepass, MotionVectorPrepass, NormalPrepass},
    smaa::SmaaPlugin,
    tonemapping::TonemappingPlugin,
    upscaling::UpscalingPlugin,
};
use bevy_app::{App, Plugin};
use bevy_asset::load_internal_asset;
use bevy_render::prelude::Shader;
use oit::OrderIndependentTransparencyPlugin;

#[derive(Default)]
pub struct CorePipelinePlugin;

impl Plugin for CorePipelinePlugin {
    fn build(&self, app: &mut App) {
        load_internal_asset!(
            app,
            FULLSCREEN_SHADER_HANDLE,
            "fullscreen_vertex_shader/fullscreen.wgsl",
            Shader::from_wgsl
        );

        app.register_type::<DepthPrepass>()
            .register_type::<NormalPrepass>()
            .register_type::<MotionVectorPrepass>()
            .register_type::<DeferredPrepass>()
            .add_plugins((
                Core2dPlugin,
                Core3dPlugin,
                CopyDeferredLightingIdPlugin,
                BlitPlugin,
                MsaaWritebackPlugin,
                TonemappingPlugin,
                UpscalingPlugin,
                BloomPlugin,
                FxaaPlugin,
                CasPlugin,
                MotionBlurPlugin,
                DepthOfFieldPlugin,
                SmaaPlugin,
                PostProcessingPlugin,
                OrderIndependentTransparencyPlugin,
            ));
    }
}