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 duiker,
18 aces,
20 filmic
21};
22
24{
25public:
31
39
40 auto init(rtti::context& ctx) -> bool;
41 auto run(gfx::render_view& rview, const run_params& params) -> gfx::frame_buffer::ptr;
42
43private:
44 auto create_or_update_output_fb(const gfx::frame_buffer::ptr& input, const gfx::frame_buffer::ptr& output) -> gfx::frame_buffer::ptr;
45
46 struct tonemapping_program : uniforms_cache
47 {
48 void cache_uniforms()
49 {
50 cache_uniform(program.get(), u_tonemapping, "u_tonemapping", gfx::uniform_type::Vec4);
51 cache_uniform(program.get(), s_input, "s_input", gfx::uniform_type::Sampler);
52 }
53
54 gfx::program::uniform_ptr u_tonemapping;
56
57 std::unique_ptr<gpu_program> program;
58
59 } tonemapping_program_;
60
62
63};
64} // namespace unravel
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.