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
filmic
,
18
aces
,
19
aces_lum
,
20
reinhard2
,
21
unreal3
,
22
lottes
,
23
uchimura
,
24
neutral
,
25
agx
,
26
agx_golden
,
27
agx_punchy
28
};
29
30
class
tonemapping_pass
31
{
32
public
:
33
struct
settings
34
{
35
float
exposure
= 1.0f;
36
tonemapping_method
method
=
tonemapping_method::neutral
;
37
};
38
39
struct
run_params
40
{
41
gfx::frame_buffer::ptr
input
;
42
gfx::frame_buffer::ptr
output
;
43
gfx::texture::ptr
exposure_texture
;
44
45
settings
config
{};
46
};
47
48
auto
init
(
rtti::context
& ctx) -> bool;
49
auto
run
(
gfx::render_view
& rview,
const
run_params& params) ->
gfx::frame_buffer::ptr
;
50
void
release_resources
(
gfx::render_view
& rview);
51
52
private
:
53
auto
create_or_update_output_fb(
gfx::render_view
& rview,
54
const
gfx::frame_buffer::ptr
&
input
,
55
const
gfx::frame_buffer::ptr
& output) ->
gfx::frame_buffer::ptr
;
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;
67
gfx::program::uniform_ptr
s_input;
68
gfx::program::uniform_ptr
s_exposure;
69
70
std::unique_ptr<gpu_program> program;
71
72
} tonemapping_program_;
73
};
74
}
// namespace unravel
camera.h
gfx::handle_impl< frame_buffer, frame_buffer_handle >::ptr
std::shared_ptr< frame_buffer > ptr
Definition
handle_impl.h:16
gfx::render_view
Definition
render_view.h:15
unravel::tonemapping_pass
Definition
tonemapping_pass.h:31
unravel::tonemapping_pass::release_resources
void release_resources(gfx::render_view &rview)
Definition
tonemapping_pass.cpp:141
unravel::tonemapping_pass::run
auto run(gfx::render_view &rview, const run_params ¶ms) -> gfx::frame_buffer::ptr
Definition
tonemapping_pass.cpp:56
unravel::tonemapping_pass::init
auto init(rtti::context &ctx) -> bool
Definition
tonemapping_pass.cpp:10
gpu_program.h
input
Definition
action_id.hpp:5
unravel
Definition
crash.cpp:21
unravel::none
@ none
Definition
entity.cpp:243
unravel::tonemapping_method
tonemapping_method
Definition
tonemapping_pass.h:11
unravel::tonemapping_method::reinhard
@ reinhard
unravel::tonemapping_method::filmic
@ filmic
unravel::tonemapping_method::reinhard2
@ reinhard2
unravel::tonemapping_method::lottes
@ lottes
unravel::tonemapping_method::unreal3
@ unreal3
unravel::tonemapping_method::agx_punchy
@ agx_punchy
unravel::tonemapping_method::agx_golden
@ agx_golden
unravel::tonemapping_method::neutral
@ neutral
unravel::tonemapping_method::hable
@ hable
unravel::tonemapping_method::reinhard_lum
@ reinhard_lum
unravel::tonemapping_method::exponential
@ exponential
unravel::tonemapping_method::uchimura
@ uchimura
unravel::tonemapping_method::aces
@ aces
unravel::tonemapping_method::agx
@ agx
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:40
unravel::tonemapping_pass::run_params::input
gfx::frame_buffer::ptr input
Definition
tonemapping_pass.h:41
unravel::tonemapping_pass::run_params::output
gfx::frame_buffer::ptr output
Definition
tonemapping_pass.h:42
unravel::tonemapping_pass::run_params::config
settings config
Definition
tonemapping_pass.h:45
unravel::tonemapping_pass::run_params::exposure_texture
gfx::texture::ptr exposure_texture
Definition
tonemapping_pass.h:43
unravel::tonemapping_pass::settings
Definition
tonemapping_pass.h:34
unravel::tonemapping_pass::settings::method
tonemapping_method method
Definition
tonemapping_pass.h:36
unravel::tonemapping_pass::settings::exposure
float exposure
Definition
tonemapping_pass.h:35
unravel::uniforms_cache
Structure for caching uniforms.
Definition
gpu_program.h:177
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:186
engine
engine
rendering
pipeline
passes
tonemapping_pass.h
Generated by
1.12.0