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
//! Post-processing: three.js's `EffectComposer` and its passes.
//!
//! The same implementation serves native Rust and the browser — the
//! JavaScript shim's `EffectComposer`, `RenderPass`, `UnrealBloomPass` and
//! the rest are thin wrappers over these, forwarding their properties and
//! uniforms through [`Pass::get`] / [`Pass::set`].
//!
//! Every pass draws through [`Renderer::run_postfx`](crate::renderer::Renderer::run_postfx):
//! one fullscreen module (`POSTFX_SHADER`) with a branch per three.js shader,
//! the passes' sequencing — buffers, ping-pong, mip chains, prepasses — here.
//! The composer's buffers are half-float, as three.js's are, so a chain
//! carries linear light; the last pass writes the screen the way three.js's
//! does, which on WebGL2 and WebGPU alike stores the same bytes.
//!
//! ```no_run
//! use threers::postprocessing::{EffectComposer, RenderPass, UnrealBloomPass, OutputPass};
//! # fn demo(renderer: &mut threers::Renderer, scene: &mut threers::Scene,
//! # camera: &threers::PerspectiveCamera, view: &threers::wgpu::TextureView) {
//! let mut composer = EffectComposer::with_size(1280, 720);
//! composer.add_pass(RenderPass::new());
//! composer.add_pass(UnrealBloomPass::new(1280, 720, 1.5, 0.4, 0.85));
//! composer.add_pass(OutputPass::new());
//! composer.set_screen_format(threers::wgpu::TextureFormat::Bgra8Unorm);
//! composer.render(renderer, scene, camera, view);
//! # }
//! ```
pub use PostBackend;
pub use EffectComposer;
pub use ;
pub use ;
pub use ;
pub use *;
pub use ;
pub use ;
/// `ShaderPass(FXAAShader)` sized to `width × height` — the name the native
/// API had for it.
pub type FxaaPass = ShaderPass;