Unravel Engine C++ Reference
Loading...
Searching...
No Matches
taa_component.h
Go to the documentation of this file.
1#pragma once
2
3#include <base/basetypes.hpp>
6
7#include <cmath>
8
9namespace unravel
10{
11
15class taa_component : public component_crtp<taa_component>
16{
17public:
18 bool enabled = false;
20
21 static void merge_into(taa_pass::settings& result,
22 const taa_pass::settings& from,
23 float contribution,
24 bool is_first)
25 {
26 if(is_first)
27 {
28 result = from;
29 return;
30 }
31 result.history_blend = std::lerp(result.history_blend, from.history_blend, contribution);
32 result.sharpen = std::lerp(result.sharpen, from.sharpen, contribution);
35 result.jitter_amplitude = std::lerp(result.jitter_amplitude, from.jitter_amplitude, contribution);
39 static_cast<std::uint32_t>(std::lround(std::lerp(static_cast<float>(result.temporal_sample_count),
40 static_cast<float>(from.temporal_sample_count),
41 contribution)));
42 if(contribution > 0.5f)
43 {
44 result.jitter_mode = from.jitter_mode;
45 }
46 }
47};
48
49} // namespace unravel
Temporal anti-aliasing (HDR, before tonemap). Mutually exclusive with FXAA when enabled.
static void merge_into(taa_pass::settings &result, const taa_pass::settings &from, float contribution, bool is_first)
CRTP (Curiously Recurring Template Pattern) base structure for components.
float sharpen
Unsharp on current neighborhood; keep low to avoid edge shimmer.
Definition taa_pass.h:32
std::uint32_t temporal_sample_count
Enable jitter when greater than 1 (full render frame index drives the sequence).
Definition taa_pass.h:21
float variance_clip_scale
Standard deviations for RGB variance clip (typical 1.0–1.75).
Definition taa_pass.h:35
taa_jitter_mode jitter_mode
Subpixel offset sequence (see taa_jitter_mode); passed to camera each frame.
Definition taa_pass.h:23
float history_blend
Blend toward clipped history (lower = less gray cast, slightly more aliasing).
Definition taa_pass.h:30
float jitter_amplitude
Scales jitter before projection (1 = full ~±½ pixel). Lower = less whole-screen shake,...
Definition taa_pass.h:25
float contribution