Skip to content

OpenGL: DirectionalLight3D applies Fade Start incorrectly when using PSSM 2 Splits or 4 Splits mode #82505

@Calinou

Description

@Calinou

Godot version

4.2.dev fbe611e

System information

Fedora 38, GeForce RTX 4090 (NVIDIA 535.104.05)

Issue description

DirectionalLight3D applies Fade Start incorrectly when using PSSM 2 Splits or 4 Splits mode. This is with Fade Start set to 1.0 – no fading should occur at all, yet the last split is always faded when using PSSM 2 Splits or PSSM 4 Splits:

Orthogonal PSSM 2 Splits PSSM 4 Splits
Screenshot_20230929_001106 Screenshot_20230929_001111 Screenshot_20230929_001116

When using Forward+ or Mobile, the effective fade distance doesn't change in any way regardless of the shadow mode used (including Orthogonal). This is the expected behavior, as it allows optimal sizing of the Shadow Max Distance when tuning shadows for small/medium-sized indoor scenes.

Steps to reproduce

  • Add some meshes in a scene.
  • Create a DirectionalLight3D node and enable shadows on it. Decrease its Shadow Max Distance to a low value like 20.
  • Play around with the Fade Start property in DirectionalLight3D, while having one of the meshes near the end of the Shadow Max Distance (so you see the shadow fade out progressively).
  • Set the shadow mode in DirectionalLight3D to Orthogonal, PSSM 2 Splits then 4 Splits.
  • Notice how fading changes.

Minimal reproduction project

test_shadow_compatibility_fade_start.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions