Unravel Engine C++ Reference
Loading...
Searching...
No Matches
ssil_component.h
Go to the documentation of this file.
1#pragma once
2
3#include <base/basetypes.hpp>
6
7namespace unravel
8{
9
10class ssil_component : public component_crtp<ssil_component>
11{
12public:
13 bool enabled = true;
15
17 const ssil_pass::ssil_settings& from,
18 float contribution,
19 bool is_first)
20 {
21 if(is_first)
22 {
23 result = from;
24 return;
25 }
26
27 result.max_rays = int(std::lerp(float(result.max_rays), float(from.max_rays), contribution));
28 result.max_steps = int(std::lerp(float(result.max_steps), float(from.max_steps), contribution));
29 result.depth_tolerance = std::lerp(result.depth_tolerance, from.depth_tolerance, contribution);
30 result.thickness = std::lerp(result.thickness, from.thickness, contribution);
31 result.brightness = std::lerp(result.brightness, from.brightness, contribution);
32 result.max_distance = std::lerp(result.max_distance, from.max_distance, contribution);
33 result.resolution = contribution >= 0.5f ? from.resolution : result.resolution;
34
37
42 result.spatial_denoise.passes = int(std::lerp(float(result.spatial_denoise.passes), float(from.spatial_denoise.passes), contribution));
44 result.spatial_denoise.max_step = int(std::lerp(float(result.spatial_denoise.max_step), float(from.spatial_denoise.max_step), contribution));
45
51 }
52};
53
54} // namespace unravel
static void merge_into(ssil_pass::ssil_settings &result, const ssil_pass::ssil_settings &from, float contribution, bool is_first)
CRTP (Curiously Recurring Template Pattern) base structure for components.
spatial_denoise_settings spatial_denoise
Definition ssil_pass.h:92
float contribution