Make DirectionalLight3D's PSSM 2 Splits shadow mode use the split_2
property for the cutoff instead of split_1
#3464
Labels
Milestone
Related to #3353 and #2729.
Describe the project you are working on
The Godot editor 🙂
Describe the problem or limitation you are having in your project
Godot offers 3 shadow modes for DirectionalLight3D. However, since only PSSM 4 Splits gives visually appealing results out of the box, people tend to forget about PSSM 2 Splits and Orthogonal shadow modes. These modes can improve performance a lot on low-end/mobile devices, so it's important to make them look as good as possible out of the box.
Orthogonal has been improved a lot in
master
, but PSSM 2 Splits still doesn't look good out of the box due to the heavy resolution discrepancy between the two splits.We can make it less noticeable by using a larger distance for the first split. This will make its shadow less detailed, but it will span a longer range. On top of that, the resolution discrepancy between the first split and second split will be decreased.
This is already something you can do by adjusting the property when changing the shadow mode, but most people don't know how to tweak shadow split distances effectively. (Also, if you offer graphics settings selection, you need to remember to adjust the split distances for every DirectionalLight3D node.)
Describe the feature / enhancement and how it helps to overcome the problem or limitation
By using the distance configured in Split 2 automatically instead of Split 1, we can choose a more suitable distance for the PSSM 2 Splits mode. This means the first split's ratio would now be 0.2 instead of 0.1 by default. This looks better in most scenes in practice, while not having any noticeable performance difference.
Split properties that don't have any impact on the current shadow mode would then be hidden from the inspector. This is what godotengine/godot#54147 implements, but it'll need to be changed to hide
split_1_distance
instead ofsplit_2_distance
when the shadow mode is PSSM 2 Splits.This proposal does not affect the Orthogonal and PSSM 4 Splits shadow modes.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Default shadow settings
This is the current appearance with PSSM 4 Splits (it won't change with this proposal):
PSSM 2 Splits with default shadow settings
This is the current appearance when you switch from PSSM 4 Splits to PSSM 2 Splits:
PSSM 2 Splits with tweaked second split distance
This is what would happen automatically if this proposal is implemented:
If this enhancement will not be used often, can it be worked around with a few lines of script?
Yes, as the shadow split distance can already be tweaked by the user. However, the goal here is to improve the default appearance so people don't shy from the lower-quality shadow modes as much when targeting mobile/web platforms 🙂
Once #3353 is implemented, we can also default to PSSM 2 Splits on mobile with more confidence.
Is there a reason why this should be core and not an add-on in the asset library?
See above.
The text was updated successfully, but these errors were encountered: