Skip to content

Commit 0fed56e

Browse files
committed
Hide last DirectionalLight shadow split distance property when using PSSM 3 Splits
The last shadow split property only has an effect when using PSSM 4 Splits.
1 parent f75abbb commit 0fed56e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

scene/3d/light.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,12 +365,17 @@ bool DirectionalLight::is_blend_splits_enabled() const {
365365

366366
void DirectionalLight::_validate_property(PropertyInfo &property) const {
367367
if (shadow_mode == SHADOW_ORTHOGONAL && (property.name == "directional_shadow_split_1" || property.name == "directional_shadow_blend_splits" || property.name == "directional_shadow_bias_split_scale")) {
368-
// Split 2, split blending and bias split scale are only used with the PSSM 2 Splits and PSSM 4 Splits shadow modes.
368+
// Splits 2/3/4, split blending and bias split scale are only used with the PSSM 2 Splits, PSSM 3 Splits and PSSM 4 Splits shadow modes.
369369
property.usage = PROPERTY_USAGE_NOEDITOR;
370370
}
371371

372-
if ((shadow_mode == SHADOW_ORTHOGONAL || shadow_mode == SHADOW_PARALLEL_2_SPLITS) && (property.name == "directional_shadow_split_2" || property.name == "directional_shadow_split_3")) {
373-
// Splits 3 and 4 are only used with the PSSM 4 Splits shadow mode.
372+
if ((shadow_mode == SHADOW_ORTHOGONAL || shadow_mode == SHADOW_PARALLEL_2_SPLITS) && (property.name == "directional_shadow_split_2")) {
373+
// Splits 3/4 are only used with the PSSM 3 Splits and PSSM 4 Splits shadow modes.
374+
property.usage = PROPERTY_USAGE_NOEDITOR;
375+
}
376+
377+
if ((shadow_mode == SHADOW_ORTHOGONAL || shadow_mode == SHADOW_PARALLEL_2_SPLITS || shadow_mode == SHADOW_PARALLEL_3_SPLITS) && (property.name == "directional_shadow_split_3")) {
378+
// Split 4 is only used with the PSSM 4 Splits shadow mode.
374379
property.usage = PROPERTY_USAGE_NOEDITOR;
375380
}
376381

0 commit comments

Comments
 (0)