SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
GraphicsConfig.cpp
Go to the documentation of this file.
2
4
5namespace Sleak {
6
7/// Builds a config with every render feature toggle set for a named quality tier.
10 switch (q) {
12 cfg.ssaoEnabled = false;
13 cfg.ssrEnabled = false;
14 cfg.bloomEnabled = false;
15 cfg.iblEnabled = false;
16 cfg.taaEnabled = false;
17 cfg.lightShaftEnabled = false;
18 cfg.shadowEnabled = false;
19 cfg.pcssEnabled = false;
20 cfg.occlusionCullingEnabled = false;
21 cfg.occlusionBufferWidth = 160;
22 cfg.occlusionBufferHeight = 90;
23 break;
24 }
26 // Shadows only — no filter, no post-FX.
27 cfg.ssaoEnabled = false;
28 cfg.ssrEnabled = false;
29 cfg.bloomEnabled = false;
30 cfg.iblEnabled = false;
31 cfg.taaEnabled = false;
32 cfg.lightShaftEnabled = false;
33 cfg.shadowEnabled = true;
34 cfg.pcssEnabled = false;
35 cfg.shadowMapResolution = 1024;
36 cfg.shadowFrustumSize = 96.0f;
37 cfg.shadowCasterDistance = 64.0f;
38 cfg.occlusionCullingEnabled = false;
39 cfg.occlusionBufferWidth = 160;
40 cfg.occlusionBufferHeight = 90;
41 break;
42 }
44 // Shadows + shadow filter + SSAO.
45 cfg.ssaoEnabled = true;
46 cfg.ssrEnabled = false;
47 cfg.bloomEnabled = false;
48 cfg.iblEnabled = false;
49 cfg.taaEnabled = false;
50 cfg.lightShaftEnabled = false;
51 cfg.shadowEnabled = true;
52 cfg.pcssEnabled = true;
53 cfg.occlusionCullingEnabled = true;
54 cfg.occlusionBufferWidth = 256;
55 cfg.occlusionBufferHeight = 144;
56 break;
57 }
59 // Shadows + SSAO + SSR + bloom + IBL + light shafts.
60 cfg.ssaoEnabled = true;
61 cfg.ssrEnabled = true;
62 cfg.bloomEnabled = true;
63 cfg.iblEnabled = true;
64 cfg.taaEnabled = false;
65 cfg.lightShaftEnabled = true;
66 cfg.shadowEnabled = true;
67 cfg.pcssEnabled = true;
68 cfg.occlusionCullingEnabled = true;
69 cfg.occlusionBufferWidth = 256;
70 cfg.occlusionBufferHeight = 144;
71 break;
72 }
74 // High + larger shadow range + TAA.
75 cfg.ssaoEnabled = true;
76 cfg.ssrEnabled = true;
77 cfg.bloomEnabled = true;
78 cfg.iblEnabled = true;
79 cfg.taaEnabled = true;
80 cfg.lightShaftEnabled = true;
81 cfg.shadowEnabled = true;
82 cfg.pcssEnabled = true;
83 cfg.shadowMapResolution = 3072;
84 cfg.shadowDistance = 256.0f;
85 cfg.shadowFrustumSize = 160.0f;
86 cfg.shadowCasterDistance = 160.0f;
87 cfg.occlusionCullingEnabled = true;
88 cfg.occlusionBufferWidth = 320;
89 cfg.occlusionBufferHeight = 180;
90 cfg.maxOccluders = 256;
91 break;
92 }
93 }
94 return cfg;
95}
96
97/// Pushes this config's shadow settings onto a directional light.
105
106} // namespace Sleak
void SetShadowFrustumSize(float size)
void SetShadowDistance(float dist)
void SetShadowBias(float bias)
Definition Light.hpp:42
void SetCastShadows(bool cast)
Definition Light.hpp:39
void SetShadowStrength(float strength)
Definition Light.hpp:45
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.