Unravel Engine C++ Reference
Loading...
Searching...
No Matches
tonemapping_pass.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace unravel
8{
9
10enum class tonemapping_method : uint8_t
11{
12 none = 0,
16 hable,
17 filmic,
18 aces,
21 unreal3,
22 lottes,
24 neutral,
25 agx,
28};
29
31{
32public:
38
47
48 auto init(rtti::context& ctx) -> bool;
49 auto run(gfx::render_view& rview, const run_params& params) -> gfx::frame_buffer::ptr;
51
52private:
53 auto create_or_update_output_fb(gfx::render_view& rview,
56
57 struct tonemapping_program : uniforms_cache
58 {
59 void cache_uniforms()
60 {
61 cache_uniform(program.get(), u_tonemapping, "u_tonemapping", gfx::uniform_type::Vec4);
62 cache_uniform(program.get(), s_input, "s_input", gfx::uniform_type::Sampler);
63 cache_uniform(program.get(), s_exposure, "s_exposure", gfx::uniform_type::Sampler);
64 }
65
66 gfx::program::uniform_ptr u_tonemapping;
69
70 std::unique_ptr<gpu_program> program;
71
72 } tonemapping_program_;
73};
74} // namespace unravel
void release_resources(gfx::render_view &rview)
auto run(gfx::render_view &rview, const run_params &params) -> gfx::frame_buffer::ptr
auto init(rtti::context &ctx) -> bool
std::shared_ptr< uniform > uniform_ptr
Definition program.h:19
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.