AMFP Enhanced
C++ reference: the code this unofficial fork added
Toggle main menu visibility
Loading...
Searching...
No Matches
ShadowMapSizes.h
Go to the documentation of this file.
1
/*
2
* AMFP-2026: shadow map size per resolution setting and light tier, unit tested in
3
* tests/cpp/test_shadow_map_sizes.cpp.
4
*/
5
#ifndef HPL_SHADOW_MAP_SIZES_H
6
#define HPL_SHADOW_MAP_SIZES_H
7
8
namespace
hpl
{
9
10
/** alSetting: 0 low, 1 medium, 2 high. alTier: 0 low, 1 medium, 2 high importance. */
11
inline
int
ShadowMapSize
(
int
alSetting,
int
alTier,
bool
abHD)
12
{
13
// Stock table: index = setting + tier (RendererDeferred.cpp).
14
static
const
int
vStock[5] = { 128, 256, 256, 512, 1024 };
15
int
lSetting = alSetting < 0 ? 0 : (alSetting > 2 ? 2 : alSetting);
16
int
lTier = alTier < 0 ? 0 : (alTier > 2 ? 2 : alTier);
17
int
lSize = vStock[lSetting + lTier];
18
// HD: at the High setting every tier doubles (2048 / 1024 / 512).
19
if
(abHD && lSetting == 2) lSize *= 2;
20
return
lSize;
21
}
22
23
}
24
25
#endif
hpl
Definition
ShadowMapSizes.h:8
hpl::ShadowMapSize
int ShadowMapSize(int alSetting, int alTier, bool abHD)
alSetting: 0 low, 1 medium, 2 high.
Definition
ShadowMapSizes.h:11
HPL2
core
include
graphics
ShadowMapSizes.h
Generated by
1.18.0