Skip to content

OpenGL: Directional Shadow Splits debug draw mode is not implemented #46129

@Calinou

Description

@Calinou

Godot version: Git 89a43d9

OS/device including version: Fedora 33, GeForce GTX 1080 (NVIDIA 460.39)

Issue description:

Following the removal of support for colored shadows to improve performance, the Directional Shadow Splits debug draw mode no longer works. It now displays exactly like the normal draw mode.

Back when colored shadows were supported, each split had different shadow colors thanks to this code:

if (get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_PSSM_SPLITS) {
light_data.shadow_color1[0] = 1.0;
light_data.shadow_color1[1] = 0.0;
light_data.shadow_color1[2] = 0.0;
light_data.shadow_color1[3] = 1.0;
light_data.shadow_color2[0] = 0.0;
light_data.shadow_color2[1] = 1.0;
light_data.shadow_color2[2] = 0.0;
light_data.shadow_color2[3] = 1.0;
light_data.shadow_color3[0] = 0.0;
light_data.shadow_color3[1] = 0.0;
light_data.shadow_color3[2] = 1.0;
light_data.shadow_color3[3] = 1.0;
light_data.shadow_color4[0] = 1.0;
light_data.shadow_color4[1] = 1.0;
light_data.shadow_color4[2] = 0.0;
light_data.shadow_color4[3] = 1.0;
} else {
light_data.shadow_color1[0] = shadow_col.r;
light_data.shadow_color1[1] = shadow_col.g;
light_data.shadow_color1[2] = shadow_col.b;
light_data.shadow_color1[3] = 1.0;
light_data.shadow_color2[0] = shadow_col.r;
light_data.shadow_color2[1] = shadow_col.g;
light_data.shadow_color2[2] = shadow_col.b;
light_data.shadow_color2[3] = 1.0;
light_data.shadow_color3[0] = shadow_col.r;
light_data.shadow_color3[1] = shadow_col.g;
light_data.shadow_color3[2] = shadow_col.b;
light_data.shadow_color3[3] = 1.0;
light_data.shadow_color4[0] = shadow_col.r;
light_data.shadow_color4[1] = shadow_col.g;
light_data.shadow_color4[2] = shadow_col.b;
light_data.shadow_color4[3] = 1.0;
}

Speaking of which, we should also remove the shadow color property from Light3D as it's no longer effective.

Steps to reproduce:

Select Debug Advanced… > Directional Shadow Splits in the 3D viewport's Perspective menu:

image

Minimal reproduction project: test_debug_draw_splits.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions