Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Tracked by #66458
Calinou opened this issue Feb 17, 2021 · 1 comment
Open
Tracked by #66458

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

Calinou opened this issue Feb 17, 2021 · 1 comment

Comments

@Calinou
Copy link
Member

Calinou commented Feb 17, 2021

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

@Calinou
Copy link
Member Author

Calinou commented Jun 25, 2024

This was fixed in 4.2.2 or earlier in Forward+ and Mobile, but the Compatibility rendering method is still missing an implementation of this debug draw mode.

@Calinou Calinou changed the title Directional Shadow Splits debug draw mode no longer works OpenGL: Directional Shadow Splits debug draw mode is not implemented Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants