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
//! Temporal Anti-Aliasing (TAA) with Halton jitter, variance clipping, and adaptive blending.
//!
//! TAA reduces aliasing by accumulating and blending multiple frames over time. Each frame
//! uses slightly different subpixel sample offsets (jitter from a Halton sequence), and the
//! history buffer is blended with the current frame. This produces high-quality anti-aliasing
//! without the memory overhead of MSAA.
//!
//! ## Key Features
//!
//! - **Halton jitter**: Quasi-random subpixel offsets with better distribution than uniform random.
//! - **Variance clipping**: Reduces ghosting by clamping history to the local color neighborhood.
//! - **Adaptive blending**: Dynamically adjusts blend factor based on per-pixel motion magnitude.
//! - **Unsharp mask sharpening**: Post-accumulation sharpening to counteract blur from blending.
//! - **Stateful accumulator**: [`TaaAccumulator`] manages jitter sequencing and history state.
//!
//! ## Relationship to [`crate::temporal`]
//!
//! Two temporal-accumulation modules coexist in this crate and are *not*
//! interchangeable:
//!
//! | Module | History reprojection | Ghosting control | Extras |
//! |---|---|---|---|
//! | [`crate::temporal_aa`] (this one) | none — history is aligned by construction | variance clipping (local mean ± σ) | Halton jitter, unsharp sharpening, RGB only |
//! | [`crate::temporal`] | motion-vector warping with bilinear resampling | 3×3 neighbourhood min/max clamp + disocclusion blend | arbitrary channel count |
//!
//! Pick this module for a static or jitter-only camera; pick
//! [`crate::temporal`] when you have a motion-vector field. Note that both
//! modules define their own `TaaConfig` and `TaaError` with different fields
//! and variants — the crate root re-exports [`crate::temporal`]'s pair, so
//! this module's must be reached through its full path.
//!
//! # Module layout
//!
//! The implementation is split by concern; every public item is re-exported
//! here, so `oxigaf_render::temporal_aa::<item>` paths are unchanged:
//!
//! - `config` — [`TaaError`] and [`TaaConfig`]
//! - `jitter` — Halton sequence and per-frame subpixel offsets
//! - `history` — the [`TaaHistory`] accumulation buffer
//! - `clipping` — local mean/σ statistics and variance clipping
//! - `accumulate` — sharpening, [`accumulate_taa`], [`TaaAccumulator`]
//! - `stats` — [`TaaStats`] and [`compute_taa_stats`]
pub use ;
pub use ;
pub use ;
pub use TaaHistory;
pub use ;
pub use ;