From 61da4882aa25e4b2ff2a25a5f57fb839accf1b46 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 1 Jun 2020 01:20:35 +0200 Subject: [PATCH] Add performance hints to the DirectionalLight shadow mode property hint This also clarifies some parts in the DirectionalLight documentation. (cherry picked from commit b46756c723ebf7345327f2819d0d8b51bc9d4e55) --- doc/classes/DirectionalLight.xml | 8 ++++---- scene/3d/light.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/classes/DirectionalLight.xml b/doc/classes/DirectionalLight.xml index e45163894fe..a78afca0c5f 100644 --- a/doc/classes/DirectionalLight.xml +++ b/doc/classes/DirectionalLight.xml @@ -43,19 +43,19 @@ - Renders the entire scene's shadow map from an orthogonal point of view. May result in blockier shadows on close objects. + Renders the entire scene's shadow map from an orthogonal point of view. This is the fastest directional shadow mode. May result in blurrier shadows on close objects. - Splits the view frustum in 2 areas, each with its own shadow map. + Splits the view frustum in 2 areas, each with its own shadow map. This shadow mode is a compromise between [constant SHADOW_ORTHOGONAL] and [constant SHADOW_PARALLEL_4_SPLITS] in terms of performance. - Splits the view frustum in 4 areas, each with its own shadow map. + Splits the view frustum in 4 areas, each with its own shadow map. This is the slowest directional shadow mode. Keeps the shadow stable when the camera moves, at the cost of lower effective shadow resolution. - Tries to achieve maximum shadow resolution. May result in saw effect on shadow edges. + Tries to achieve maximum shadow resolution. May result in saw effect on shadow edges. This mode typically works best in games where the camera will often move at high speeds, such as most racing games. diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index 593d0b95b78..09d696bccd9 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -389,7 +389,7 @@ void DirectionalLight::_bind_methods() { ClassDB::bind_method(D_METHOD("is_blend_splits_enabled"), &DirectionalLight::is_blend_splits_enabled); ADD_GROUP("Directional Shadow", "directional_shadow_"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "directional_shadow_mode", PROPERTY_HINT_ENUM, "Orthogonal,PSSM 2 Splits,PSSM 4 Splits"), "set_shadow_mode", "get_shadow_mode"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "directional_shadow_mode", PROPERTY_HINT_ENUM, "Orthogonal (Fast),PSSM 2 Splits (Average),PSSM 4 Splits (Slow)"), "set_shadow_mode", "get_shadow_mode"); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "directional_shadow_split_1", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_param", "get_param", PARAM_SHADOW_SPLIT_1_OFFSET); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "directional_shadow_split_2", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_param", "get_param", PARAM_SHADOW_SPLIT_2_OFFSET); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "directional_shadow_split_3", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_param", "get_param", PARAM_SHADOW_SPLIT_3_OFFSET);