SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
GraphicsConfig.hpp
Go to the documentation of this file.
1#ifndef _GRAPHICSCONFIG_HPP_
2#define _GRAPHICSCONFIG_HPP_
3
4#include <Core/OSDef.hpp>
5#include <cstdint>
6
7namespace Sleak {
8
10
11/// Named quality tiers a GraphicsConfig preset can be built from.
12/// @ingroup core
14
15/// Data-driven render settings applied to a renderer in one shot via
16/// Application::ApplyGraphicsConfig(). Game owns and persists this.
17/// @ingroup core
18struct ENGINE_API GraphicsConfig {
19 // Post-FX (deferred path)
20 bool ssaoEnabled = false;
21 float ssaoRadius = 0.5f;
22 float ssaoBias = 0.012f;
23 float ssaoPower = 2.5f;
24 bool ssrEnabled = false;
25 bool bloomEnabled = true;
26 bool iblEnabled = false;
27 float iblIntensity = 1.0f;
28 bool taaEnabled = false;
29
30 // Shadows
31 bool shadowEnabled = true;
32 uint32_t shadowMapResolution = 2048;
33 float shadowDistance = 160.0f;
34 float shadowFrustumSize = 96.0f;
35 float shadowCasterDistance = 96.0f; // game uses for shadow-caster culling
36 float shadowBias = 0.002f;
37 float shadowStrength = 1.0f;
38
39 // Culling
42 uint32_t occlusionBufferWidth = 256;
43 uint32_t occlusionBufferHeight = 144;
44 uint32_t maxOccluders = 192;
45
46 // Misc
47 uint32_t msaaSamples = 1;
48
49 // Tonemap / post
50 bool tonemapEnabled = false;
51 float exposure = 1.0f;
52 float gamma = 2.2f;
53
54 // PCSS soft shadows
55 bool pcssEnabled = true;
56
57 // Procedural sky
59 float skyHorizonNear = 1.0f;
60 float skyHorizonFar = 1.5f;
61
62 // Volumetric light shafts
63 bool lightShaftEnabled = false;
64 float lightShaftStrength = 1.0f;
65 uint32_t lightShaftSamples = 7;
66 float lightShaftMaxDist = 128.0f;
67
68 // AA / sharpen
69 bool fxaaEnabled = false;
70 float fxaaSubpixel = 0.5f;
71 float sharpenStrength = 0.0f;
72
73 // Grading
74 float saturation = 1.0f;
75 float vibrance = 1.0f;
76 bool vignetteEnabled = false;
77 float vignetteStrength = 1.06f;
78 bool filmGrainEnabled = false;
79 bool autoExposureEnabled = false;
80 float autoExposureRadius = 0.7f;
81 float autoExposureSpeed = 3.33f;
82
83 // Lighting
84 float minLight = 0.0f;
85 bool desaturationEnabled = false;
86 float desaturationFactor = 1.5f;
87
88 // Render scale
89 float renderScale = 1.0f;
90
91 /// Builds a config from a named quality preset.
93
94 /// Copies the shadow-related fields onto a directional light.
95 void ApplyShadows(Sleak::DirectionalLight& light) const;
96};
97
98} // namespace Sleak
99
100#endif // _GRAPHICSCONFIG_HPP_
Root namespace for everything the engine exposes.
Definition Camera.hpp:10
void ApplyShadows(Sleak::DirectionalLight &light) const
Copies the shadow-related fields onto a directional light.
static GraphicsConfig Preset(GraphicsQuality q)
Builds a config from a named quality preset.