]> git.lizzy.rs Git - minetest.git/blob - src/lighting.h
Add keybind to swap items between hands
[minetest.git] / src / lighting.h
1 /*
2 Minetest
3 Copyright (C) 2021 x2048, Dmitry Kostenko <codeforsmile@gmail.com>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #pragma once
21
22
23 /**
24  * Parameters for automatic exposure compensation
25  *
26  * Automatic exposure compensation uses the following equation:
27  *
28  * wanted_exposure = 2^exposure_correction / clamp(observed_luminance, 2^luminance_min, 2^luminance_max)
29  *
30  */
31 struct AutoExposure
32 {
33     /// @brief Minimum boundary for computed luminance
34     float luminance_min;
35     /// @brief Maximum boundary for computed luminance
36     float luminance_max;
37     /// @brief Luminance bias. Higher values make the scene darker, can be negative.
38     float exposure_correction;
39     /// @brief Speed of transition from dark to bright scenes
40     float speed_dark_bright;
41     /// @brief Speed of transition from bright to dark scenes
42     float speed_bright_dark;
43     /// @brief Power value for center-weighted metering. Value of 1.0 measures entire screen uniformly
44     float center_weight_power;
45
46     AutoExposure();
47 };
48
49 /** Describes ambient light settings for a player
50  */
51 struct Lighting
52 {
53     AutoExposure exposure;
54     float shadow_intensity {0.0f};
55     float saturation {1.0f};
56 };