Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f73ccfd
WIP post_processing plugin copy
IceSentry Aug 4, 2025
79f8056
move plugin to bevy_pbr
IceSentry Aug 4, 2025
8789c3e
add some comments
IceSentry Aug 4, 2025
75c494a
customizable edges
IceSentry Aug 4, 2025
ec128ca
yeet changes to custom_post_processing
IceSentry Aug 4, 2025
6596a79
move to core_pipeline
IceSentry Aug 9, 2025
70e61bd
add custom sub_graph and more docs
IceSentry Aug 9, 2025
92f0872
fix imports
IceSentry Aug 9, 2025
9e003bd
fix example definition
IceSentry Aug 9, 2025
1e94f5e
add release notes
IceSentry Aug 9, 2025
bb1a880
fix docs
IceSentry Aug 9, 2025
8e06994
fix docs
IceSentry Aug 9, 2025
ab74519
fix docs
IceSentry Aug 9, 2025
659b77a
compile_fail
IceSentry Aug 9, 2025
de97f88
fix docs
IceSentry Aug 10, 2025
43cbadf
Merge branch 'main' into fullscreen_material
IceSentry Aug 10, 2025
44947bb
Merge branch 'main' into fullscreen_material
IceSentry Sep 5, 2025
8d37f58
Rename PostProcessSettings in shader
IceSentry Sep 10, 2025
220a9f8
Merge branch 'main' into fullscreen_material
IceSentry Nov 11, 2025
26456a1
fix after merge
IceSentry Nov 11, 2025
ce975ca
add automatic label generation
IceSentry Nov 11, 2025
bc096ec
fix ci
IceSentry Nov 11, 2025
a773d19
make sub_graph optional
IceSentry Nov 11, 2025
a613745
fix doc
IceSentry Nov 11, 2025
0b0d384
Update crates/bevy_core_pipeline/src/fullscreen_material.rs
IceSentry Dec 14, 2025
92a98e3
Update crates/bevy_core_pipeline/src/fullscreen_material.rs
IceSentry Dec 14, 2025
ae14418
Merge branch 'main' into fullscreen_material
alice-i-cecile Dec 14, 2025
1d55f78
cargo fmt
alice-i-cecile Dec 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3113,6 +3113,17 @@ description = "Demonstrates how to write a specialized mesh pipeline"
category = "Shaders"
wasm = true

[[example]]
name = "fullscreen_material"
path = "examples/shader_advanced/fullscreen_material.rs"
doc-scrape-examples = true

[package.metadata.example.fullscreen_material]
name = "Fullscreen Material"
description = "Demonstrates how to write a fullscreen material"
category = "Shaders Advanced"
wasm = true

# Stress tests
[[package.metadata.example_category]]
name = "Stress Tests"
Expand Down Expand Up @@ -3992,6 +4003,9 @@ name = "fallback_image"
path = "examples/shader/fallback_image.rs"
doc-scrape-examples = true

[package.metadata.example.fallback_image]
hidden = true

[[example]]
name = "reflection_probes"
path = "examples/3d/reflection_probes.rs"
Expand All @@ -4003,9 +4017,6 @@ description = "Demonstrates reflection probes"
category = "3D Rendering"
wasm = false

[package.metadata.example.fallback_image]
hidden = true

[package.metadata.example.window_resizing]
name = "Window Resizing"
description = "Demonstrates resizing and responding to resizing a window"
Expand Down
50 changes: 50 additions & 0 deletions assets/shaders/fullscreen_effect.wgsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// This shader computes the chromatic aberration effect

// Since post processing is a fullscreen effect, we use the fullscreen vertex shader provided by bevy.
// This will import a vertex shader that renders a single fullscreen triangle.
//
// A fullscreen triangle is a single triangle that covers the entire screen.
// The box in the top left in that diagram is the screen. The 4 x are the corner of the screen
//
// Y axis
// 1 | x-----x......
// 0 | | s | . ´
// -1 | x_____x´
// -2 | : .´
// -3 | :´
// +--------------- X axis
// -1 0 1 2 3
//
// As you can see, the triangle ends up bigger than the screen.
//
// You don't need to worry about this too much since bevy will compute the correct UVs for you.
#import bevy_core_pipeline::fullscreen_vertex_shader::FullscreenVertexOutput

@group(0) @binding(0) var screen_texture: texture_2d<f32>;
@group(0) @binding(1) var texture_sampler: sampler;

struct FullScreenEffect {
intensity: f32,
#ifdef SIXTEEN_BYTE_ALIGNMENT
// WebGL2 structs must be 16 byte aligned.
_webgl2_padding: vec3<f32>
#endif
}

@group(0) @binding(2) var<uniform> settings: FullScreenEffect;

@fragment
fn fragment(in: FullscreenVertexOutput) -> @location(0) vec4<f32> {
// Chromatic aberration strength
let offset_strength = settings.intensity;

// Sample each color channel with an arbitrary shift
return vec4<f32>(
textureSample(screen_texture, texture_sampler, in.uv + vec2<f32>(offset_strength, -offset_strength)).r,
textureSample(screen_texture, texture_sampler, in.uv + vec2<f32>(-offset_strength, 0.0)).g,
textureSample(screen_texture, texture_sampler, in.uv + vec2<f32>(0.0, offset_strength)).b,
1.0
);
}


Loading