bevyengine/bevy
bevy_core_pipeline
The shared 2D and 3D core render pipeline. Defines the standard render-graph nodes (clear, prepass, main pass, tonemapping, bloom, OIT) and the standard phase-item types (Opaque3d, AlphaMask3d, Transparent3d, Opaque2d, Transparent2d).
Purpose
bevy_core_pipeline is the layer between bevy_render and the per-domain rendering crates (bevy_pbr, bevy_sprite_render, bevy_ui_render). It provides the scaffolding both 2D and 3D pipelines share:
- Core 2D pipeline (
core_2d/) — the 2D render graph and phase items. - Core 3D pipeline (
core_3d/) — the 3D render graph and phase items, including OIT (order-independent transparency). - Tonemapping (
tonemapping/) — exposure + tonemap shader, with built-in tonemap operators (Reinhard, ACES, AgX, BlenderFilmic, …). - Bloom (
bloom/) — physically based bloom. - Skybox (
skybox/) — cubemap-based sky. - MSAA — multi-sample anti-aliasing setup.
- Prepass (
prepass/) — depth, normal, motion-vector pre-passes used by TAA, SSAO, deferred. - Auto-exposure (
auto_exposure/) — luminance-based exposure adjustment. - OIT (
oit/) — order-independent transparency.
Directory layout
crates/bevy_core_pipeline/src/
├── lib.rs # CorePipelinePlugin
├── core_2d/ # 2D pipeline
├── core_3d/ # 3D pipeline (forward + deferred wiring)
├── prepass/ # Depth/normal/motion prepass
├── tonemapping/ # Tonemap node + presets
├── bloom/ # Bloom downsample/upsample chain
├── skybox/ # Skybox node + cubemap material
├── auto_exposure/ # Luminance-driven exposure
├── motion_blur/ # Motion blur
├── oit/ # Order-independent transparency
├── msaa_writeback/ # MSAA resolve to non-MSAA target
├── post_process/ # Shared post-process plumbing
├── upscaling/ # Render-target upscaling
├── dof/ # Depth of field (lives here, not in bevy_post_process)
└── …Key abstractions
| Type | File | Description |
|---|---|---|
Core2dPlugin, Core3dPlugin |
crates/bevy_core_pipeline/src/{core_2d,core_3d}/mod.rs |
Per-domain plugins. |
Opaque3d, AlphaMask3d, Transparent3d |
crates/bevy_core_pipeline/src/core_3d/main_opaque_pass_3d_node.rs etc |
3D phase items. |
Opaque2d, Transparent2d |
crates/bevy_core_pipeline/src/core_2d/ |
2D phase items. |
Camera3d, Camera2d |
crates/bevy_core_pipeline/src/{core_2d,core_3d}/camera_*.rs |
Marker components opting cameras into a pipeline. |
Tonemapping |
crates/bevy_core_pipeline/src/tonemapping/mod.rs |
Per-camera tonemap operator. |
Bloom |
crates/bevy_core_pipeline/src/bloom/settings.rs |
Per-camera bloom settings. |
MotionBlur |
crates/bevy_core_pipeline/src/motion_blur/mod.rs |
Per-camera motion-blur settings. |
DepthOfField |
crates/bevy_core_pipeline/src/dof/mod.rs |
DOF settings. |
Skybox |
crates/bevy_core_pipeline/src/skybox/mod.rs |
Cubemap skybox component. |
How it works
On adding Core3dPlugin, the render graph gains:
Clear → MainPrepass (optional) → MainOpaquePass → MainTransparentPass → Tonemapping → Bloom → Upscaling → OutputEach box is a render-graph node. Plugins like bevy_pbr::PbrPlugin or bevy_anti_alias::TemporalAntiAliasPlugin insert their own nodes around these.
The 2D pipeline is simpler: clear, sprite/UI passes, tonemapping, output.
Integration points
- Depends on:
bevy_render,bevy_camera,bevy_color,bevy_image,bevy_math,bevy_asset. - Depended on by:
bevy_pbr,bevy_sprite_render,bevy_ui_render,bevy_anti_alias,bevy_post_process,bevy_solari,bevy_gizmos_render.
Entry points for modification
- New tonemap operator: edit
tonemapping/mod.rsto add a variant andtonemapping_shared.wgslfor the math. - New phase item: template off
Opaque3d. The trait-impl boilerplate is incrates/bevy_render/src/render_phase/. - Insert a custom render-graph node: any plugin can call
RenderGraph::add_node/add_node_edgeagainst the core 3d/2d sub-graphs.
See also
bevy_renderfor the underlying render-graph machinery.bevy_pbr,bevy_sprite_render,bevy_ui_render— the consumers.- Rendering pipeline feature page.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.