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

Vulkan: PointLight2D shadows only partially appear #55806

Closed
kezzbracey opened this issue Dec 11, 2021 · 2 comments · Fixed by #63057
Closed

Vulkan: PointLight2D shadows only partially appear #55806

kezzbracey opened this issue Dec 11, 2021 · 2 comments · Fixed by #63057

Comments

@kezzbracey
Copy link

kezzbracey commented Dec 11, 2021

Godot version

v4.0.dev.20211210.official [21b8199]

System information

Kubuntu 21.04, NVIDIA GTX1080, X11, nvidia-driver-470, Vulkan clustered and mobile, Intel i7-7700

Issue description

For me only a partial pointlight2d shadow is generated, and only from certain directions:

Screenshot_20211211_113353

And no shadow from other directions:

Screenshot_20211211_113447

Directional shadows work perfectly:

Screenshot_20211211_113610

Same result on both clustered & mobile. Changing the occluder shape has no effect.

Have tested on the last 3 builds, and on the oldest build up on the tuxfamily download list.

Steps to reproduce

Create a new project, make a new 2d scene and add a background (sprite or polygon2d), PointLight2d and texture, LightOccluder2d and occluder polygon.

Turn on shadows on the light and move it around the occluder.

Minimal reproduction project

point2dshadows.zip

@Chaosus Chaosus added this to the 4.0 milestone Dec 11, 2021
@Calinou Calinou changed the title Godot 4 PointLight2d shadows only partially appear. Vulkan: PointLight2D shadows only partially appear Dec 11, 2021
@sakrel
Copy link
Contributor

sakrel commented Dec 12, 2021

this call to draw_list_begin in light_update_shadow seems to clear the entire shadow atlas instead of the rect that is supposed to be drawn to:

for (int i = 0; i < 4; i++) {
//make sure it remains orthogonal, makes easy to read angle later
//light.basis.scale(Vector3(to_light.elements[0].length(),to_light.elements[1].length(),1));
Rect2i rect((state.shadow_texture_size / 4) * i, p_shadow_index * 2, (state.shadow_texture_size / 4), 2);
RD::DrawListID draw_list = RD::get_singleton()->draw_list_begin(state.shadow_fb, RD::INITIAL_ACTION_CLEAR, RD::FINAL_ACTION_READ, RD::INITIAL_ACTION_CLEAR, RD::FINAL_ACTION_DISCARD, cc, 1.0, 0, rect);

@h0lley
Copy link

h0lley commented May 13, 2022

this broke on Jan 25, 2021, commit 71f0b4f, where reduz' PR #45376 got merged.
unfortunately it's quite a large PR, so I can't boil it down any further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants