CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
RendererLightSettings.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
12
14
15namespace CeresEngine {
16
19 Fixed,
20
24
29 };
30
42
44
54
59
60 public:
62 static const ShadowMapUpdateStrategy Once; // NOLINT
63
67 static const ShadowMapUpdateStrategy EveryFrame; // NOLINT
68
72 static constexpr ShadowMapUpdateStrategy Every(const UInt32 frequency) noexcept { // NOLINT
73 return frequency;
74 }
75
77 static const ShadowMapUpdateStrategy Never; // NOLINT
78
79 public: // Reflection
82 template<typename Processor> static constexpr void reflect(Processor&& RTTI) { CE_REFL_DATA(frequency); }
83 };
84
91 bool shimmerReduction = true;
92
96 double minimumNearPlane = 0.001;
97
101 double maximumFarPlane = 40.0;
102
103 public: // Reflection
106 template<typename Processor> static constexpr void reflect(Processor&& RTTI) {
107 CE_REFL_DATA(shimmerReduction);
108 CE_REFL_DATA(minimumNearPlane);
109 CE_REFL_DATA(maximumFarPlane);
110 }
111 };
112
145
146 // ---------------------------------------------------------------------------------------------
147 // ---------------------------------------------------------------------------------------------
148
154
155 public: // Reflection
158 template<typename Processor> static constexpr void reflect(Processor&& RTTI) { CE_REFL_DATA(shadowMapSettings); }
159 };
160
161} // namespace CeresEngine
162
165
168
171
172
173
174
175
176
177
#define CE_REFLECT_HASH(T)
Definition Hash.hpp:89
#define CE_REFL_DATA(N)
Definition Macros.hpp:541
#define CE_SCRIPT_EXPORT(...)
The CE_SCRIPT_EXPORT macro marks a class or method as exportable and available in scripting environme...
Definition Macros.hpp:247
#define CE_EXPLICIT(EXPR)
Definition Macros.hpp:413
Definition Application.hpp:19
UInt32 ShadowMapResolution
Definition RendererLightSettings.hpp:43
std::uint32_t UInt32
Definition DataTypes.hpp:23
SoftShadowTechnique
Definition RendererLightSettings.hpp:31
@ Variance
Uses variance shadow mapping when rendering the shadows.
@ PercentageCloseFiltering
Uses percentage close filtering (PCF) when rendering the shadows.
ShadowMapTechnique
Definition RendererLightSettings.hpp:17
@ Cascaded
Renders multiple shadow maps, cascading them in the entire view frustum.
@ Fixed
Renders the shadow map from a fixed point.
@ Perspective
Projects the shadow map to all objects visible in the camera's view frustum.
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
A structure stored in the component that allows the user to customize the algorithm parameters.
Definition RendererLightSettings.hpp:87
A structure that holds renderer-specific settings for a Light.
Definition RendererLightSettings.hpp:150
ShadowMapSettings shadowMapSettings
Settings that control how shadow mapping should be performed for the light.
Definition RendererLightSettings.hpp:153
static constexpr void reflect(Processor &&RTTI)
Executes the given processor for every field of the struct.
Definition RendererLightSettings.hpp:158
Definition RendererLightSettings.hpp:113
double bias
The bias is a fixed offset applied to every shadow map sample in or to minimize the effect of shadow ...
Definition RendererLightSettings.hpp:119
ShadowMapTechnique technique
The technique to be used when computing shadows from a shadow map.
Definition RendererLightSettings.hpp:115
ShadowMapUpdateStrategy updateStrategy
A value that describes the strategy used to update the shadow map.
Definition RendererLightSettings.hpp:132
static constexpr void reflect(Processor &&RTTI)
Executes the given processor for every field of the struct.
Definition RendererLightSettings.hpp:137
UInt32 percentageCloseFilteringSamples
The number of PCF samples to be taken in each axis.
Definition RendererLightSettings.hpp:126
bool usePercentageCloseFiltering
If PCF is enabled, the image will be sampled multiple times in order to create a smooth shadow.
Definition RendererLightSettings.hpp:123
double percentageCloseFilteringSamplingDistance
The sampling distance to be applied for every PCF sample.
Definition RendererLightSettings.hpp:129
A structure that describes the strategy that should be used to update a shadow map.
Definition RendererLightSettings.hpp:47
UInt32 frequency
The update frequency.
Definition RendererLightSettings.hpp:53
static const ShadowMapUpdateStrategy Once
Updates the shadow map once and then uses it as static map.
Definition RendererLightSettings.hpp:62
static constexpr ShadowMapUpdateStrategy Every(const UInt32 frequency) noexcept
The shadow map will be updated according to the frequency parameter.
Definition RendererLightSettings.hpp:72
static constexpr void reflect(Processor &&RTTI)
Executes the given processor for every field of the struct.
Definition RendererLightSettings.hpp:82
static const ShadowMapUpdateStrategy Never
Never updates the shadow map.
Definition RendererLightSettings.hpp:77
static const ShadowMapUpdateStrategy EveryFrame
The shadow map will be updated according to the updateFrequency parameter.
Definition RendererLightSettings.hpp:67