Unravel Engine C++ Reference
Loading...
Searching...
No Matches
taa_pass.h
Go to the documentation of this file.
1#pragma once
2
5#include <base/basetypes.hpp>
8
9namespace unravel
10{
11
16{
17public:
37
46
47 auto init(rtti::context& ctx) -> bool;
48
49 auto run(gfx::render_view& rview, const run_params& params) -> gfx::frame_buffer::ptr;
50
52
53private:
54 auto create_or_update_history_tex(gfx::render_view& rview,
55 const gfx::frame_buffer::ptr& reference_color) -> gfx::texture::ptr;
56
57 auto create_or_update_temp_fb(gfx::render_view& rview,
58 const gfx::frame_buffer::ptr& reference_color) -> gfx::frame_buffer::ptr;
59
60 struct taa_program : uniforms_cache
61 {
62 void cache_uniforms()
63 {
64 cache_uniform(program.get(), s_curr, "s_curr", gfx::uniform_type::Sampler);
65 cache_uniform(program.get(), s_history, "s_history", gfx::uniform_type::Sampler);
66 cache_uniform(program.get(), s_depth, "s_depth", gfx::uniform_type::Sampler);
67 cache_uniform(program.get(), u_prev_view_proj, "u_prev_view_proj", gfx::uniform_type::Mat4);
68 cache_uniform(program.get(), u_taa_params, "u_taa_params", gfx::uniform_type::Vec4);
69 }
70
74 gfx::program::uniform_ptr u_prev_view_proj;
75 gfx::program::uniform_ptr u_taa_params;
76 std::unique_ptr<gpu_program> program;
77 } program_;
78};
79
80} // namespace unravel
Class representing a camera. Contains functionality for manipulating and updating a camera....
Definition camera.h:62
HDR temporal anti-aliasing resolve (depth reprojection). Phase 2: optional velocity buffer.
Definition taa_pass.h:16
auto init(rtti::context &ctx) -> bool
Definition taa_pass.cpp:19
void release_resources(gfx::render_view &rview)
Definition taa_pass.cpp:151
auto run(gfx::render_view &rview, const run_params &params) -> gfx::frame_buffer::ptr
Definition taa_pass.cpp:69
taa_jitter_mode
Subpixel jitter sequence for temporal AA (see camera::set_aa_data).
Definition camera.h:25
std::shared_ptr< uniform > uniform_ptr
Definition program.h:19
gfx::frame_buffer::ptr output
Definition taa_pass.h:41
gfx::frame_buffer::ptr input
Definition taa_pass.h:40
gfx::frame_buffer::ptr g_buffer
Definition taa_pass.h:43
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
Structure for caching uniforms.
void cache_uniform(gpu_program *program, gfx::program::uniform_ptr &uniform, const hpp::string_view &name, gfx::uniform_type type, uint16_t num=1)
Caches a uniform in the GPU program.