Skip to content

Shadow Frustum Culling bug #7930

@Eldarduil

Description

@Eldarduil

Is there an existing issue for this?

Describe the bug

Shadows can only be visible from one direction and cannot be visible from another direction.

It seems like Shadow frustum orientation only locked to the directional light's rotation. or some values of the directional light has strange issue. Not sure exactly what is wrong, But my guess is, Directional Light's shadow bound gizmos are not big enough so since its targeting the scene camera it cut shorts on the opposite side of the light direction.

Shadows can be seen from very long distance:
Image

Almost about same distance away but now the light is behind the camera:
Image

ShadowFrustum03.mp4

Here I tried to explain the issue how I think it is happening. When the camera is looking away from the direction of the light, it only see the area that shadow casting boundary doesn't reaches. No matter how big number you put on your distance from layer's camera and shadows frustum size this issue still persist. I guess we need couple extra settings to fix this type of issue for rendering far shadows

Image

as it can be seen on this example finding the perfect sweet spot is not easy
https://threejs.org/examples/webgl_shadowmap_csm

But if more options given for directional light, user can find the sweet spot for their game's need. Also without visualization of the light and shadows boundaries it might be hard setup, but personally it is always better to have all the options of the lights sources that threejs gives us.

Steps to reproduce

Example Project:
Shadow Frustum Test.zip

GDevelop platform

Desktop

GDevelop version

5.5.244

Platform info

OS Windows

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions