Add Graphics.ShadowUpdateRate to control global shadows atlas update rate
This commit is contained in:
@@ -18,6 +18,7 @@ Quality Graphics::SSAOQuality = Quality::Medium;
|
||||
Quality Graphics::VolumetricFogQuality = Quality::High;
|
||||
Quality Graphics::ShadowsQuality = Quality::Medium;
|
||||
Quality Graphics::ShadowMapsQuality = Quality::Medium;
|
||||
float Graphics::ShadowUpdateRate = 1.0f;
|
||||
bool Graphics::AllowCSMBlending = false;
|
||||
Quality Graphics::GlobalSDFQuality = Quality::High;
|
||||
Quality Graphics::GIQuality = Quality::High;
|
||||
|
||||
@@ -48,6 +48,11 @@ public:
|
||||
/// </summary>
|
||||
API_FIELD() static Quality ShadowMapsQuality;
|
||||
|
||||
/// <summary>
|
||||
/// The global scale for all shadow maps update rate. Can be used to slow down shadows rendering frequency on lower quality settings or low-end platforms. Default 1.
|
||||
/// </summary>
|
||||
API_FIELD() static float ShadowUpdateRate;
|
||||
|
||||
/// <summary>
|
||||
/// Enables cascades splits blending for directional light shadows.
|
||||
/// [Deprecated in v1.9]
|
||||
|
||||
@@ -224,7 +224,7 @@ struct ShadowAtlasLight
|
||||
const float shadowsUpdateRate = light.ShadowsUpdateRate;
|
||||
const float shadowsUpdateRateAtDistance = shadowsUpdateRate * light.ShadowsUpdateRateAtDistance;
|
||||
float updateRate = Math::Lerp(shadowsUpdateRate, shadowsUpdateRateAtDistance, Math::Saturate(distanceFromView / Distance));
|
||||
// TODO: add global shadows update rate scale to be adjusted per-platform
|
||||
updateRate *= Graphics::ShadowUpdateRate;
|
||||
freezeUpdate = updateRate <= ZeroTolerance;
|
||||
if (freezeUpdate)
|
||||
return 0.0f;
|
||||
|
||||
Reference in New Issue
Block a user