Unravel Engine C++ Reference
Loading...
Searching...
No Matches
tonemapping_pass.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
engine/rendering/camera.h
>
4
#include <
engine/rendering/gpu_program.h
>
5
#include <
graphics/render_view.h
>
6
7
namespace
unravel
8
{
9
10
enum class
tonemapping_method
: uint8_t
11
{
12
none
= 0,
13
exponential
,
14
reinhard
,
15
reinhard_lum
,
16
hable
,
17
duiker
,
18
aces
,
19
aces_lum
,
20
filmic
21
};
22
23
class
tonemapping_pass
24
{
25
public
:
26
struct
settings
27
{
28
float
exposure
= 1.0f;
29
tonemapping_method
method
=
tonemapping_method::aces
;
30
};
31
32
struct
run_params
33
{
34
gfx::frame_buffer::ptr
input
;
35
gfx::frame_buffer::ptr
output
;
36
37
settings
config
{};
38
};
39
40
auto
init
(
rtti::context
& ctx) -> bool;
41
auto
run
(
gfx::render_view
& rview,
const
run_params& params) ->
gfx::frame_buffer::ptr
;
42
43
private
:
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;
55
gfx::program::uniform_ptr
s_input;
56
57
std::unique_ptr<gpu_program> program;
58
59
} tonemapping_program_;
60
61
gfx::frame_buffer::ptr
output_;
62
63
};
64
}
// namespace unravel
camera.h
gfx::handle_impl< frame_buffer, frame_buffer_handle >::ptr
std::shared_ptr< frame_buffer > ptr
Definition
handle_impl.h:13
gfx::render_view
Definition
render_view.h:15
unravel::tonemapping_pass
Definition
tonemapping_pass.h:24
unravel::tonemapping_pass::run
auto run(gfx::render_view &rview, const run_params ¶ms) -> gfx::frame_buffer::ptr
Definition
tonemapping_pass.cpp:72
unravel::tonemapping_pass::init
auto init(rtti::context &ctx) -> bool
Definition
tonemapping_pass.cpp:9
gpu_program.h
input
Definition
action_id.hpp:5
unravel
Definition
crash.cpp:21
unravel::none
@ none
Definition
entity.cpp:215
unravel::tonemapping_method
tonemapping_method
Definition
tonemapping_pass.h:11
unravel::tonemapping_method::reinhard
@ reinhard
unravel::tonemapping_method::filmic
@ filmic
unravel::tonemapping_method::hable
@ hable
unravel::tonemapping_method::reinhard_lum
@ reinhard_lum
unravel::tonemapping_method::exponential
@ exponential
unravel::tonemapping_method::duiker
@ duiker
unravel::tonemapping_method::aces
@ aces
unravel::tonemapping_method::aces_lum
@ aces_lum
render_view.h
gfx::program::uniform_ptr
std::shared_ptr< uniform > uniform_ptr
Definition
program.h:19
rtti::context
Definition
context.hpp:14
unravel::tonemapping_pass::run_params
Definition
tonemapping_pass.h:33
unravel::tonemapping_pass::run_params::input
gfx::frame_buffer::ptr input
Definition
tonemapping_pass.h:34
unravel::tonemapping_pass::run_params::output
gfx::frame_buffer::ptr output
Definition
tonemapping_pass.h:35
unravel::tonemapping_pass::run_params::config
settings config
Definition
tonemapping_pass.h:37
unravel::tonemapping_pass::settings
Definition
tonemapping_pass.h:27
unravel::tonemapping_pass::settings::method
tonemapping_method method
Definition
tonemapping_pass.h:29
unravel::tonemapping_pass::settings::exposure
float exposure
Definition
tonemapping_pass.h:28
unravel::uniforms_cache
Structure for caching uniforms.
Definition
gpu_program.h:171
unravel::uniforms_cache::cache_uniform
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.
Definition
gpu_program.h:180
UnravelEngine
UnravelEngine
engine
engine
rendering
pipeline
passes
tonemapping_pass.h
Generated by
1.12.0