Unravel Engine C++ Reference
Loading...
Searching...
No Matches
tonemapping_component.h
Go to the documentation of this file.
1#pragma once
2
3#include <base/basetypes.hpp>
6
7namespace unravel
8{
9
10class tonemapping_component : public component_crtp<tonemapping_component>
11{
12public:
14 bool enabled = true;
15
18
22 float contribution,
23 bool is_first)
24 {
25 if(is_first)
26 {
27 result = from;
28 return;
29 }
30 result.exposure = std::lerp(result.exposure, from.exposure, contribution);
31 if(contribution >= 0.5f)
32 {
33 result.method = from.method;
34 }
35 }
36};
37
38} // namespace unravel
static void merge_into(tonemapping_pass::settings &result, const tonemapping_pass::settings &from, float contribution, bool is_first)
Merges this component's settings into result. For first contribution, copies; otherwise lerps.
bool enabled
Whether tonemapping is enabled.
CRTP (Curiously Recurring Template Pattern) base structure for components.
float contribution