You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating 33 OmniLight3D objects with shadows that are visible at the same time the nearest lights to the camera are sometimes broken.. I would expect that shadows would be allocated based on camera distance but they seem to get 'stuck'....
I would expect the following behavior:
Lights closer to the camera should have priority in the texture atlas so they never go dark
Using distance fade should reallocate the texture atlas when light shadows fade out, it doesn't seem to do this
WORKAROUND:
Adding more texture slots in the shadow atlas avoids this issue by creating enough shadow maps for all the lights.
Steps to reproduce
Load the reproduction project and run it. Notice that some lights are 'off'
Recreating all the lights seems to correct the issue, but that sounds expensive...
This may be partially fixed in Beta 1 as there was a problem where regions could over-allocate and then lights would get stuck (#91545). #89729 may also help.
Ultimately, we need to overhaul the shadow quadrant selection process. Right now it gives priority to closer lights, but its still possible for lights to get stuck and not update when they should. Basically, right now lights try to grab an appropriate quadrant given their size and distance from the camera. When there is heavy contention for quadrants, this can lead to certain lights not getting a good spot.
We need to ensure that the closest lights always get a spot on the atlas and that lights jump quadrants as little as possible
Testing the MRP locally I can reproduce some issues with dev6 (not to the extent that you show in your post though). All the issues I can reproduce are fixed in latest master though. In master, all lights appear on the mesh just fine and there is no flickering
from my testing I've found that it just keeps lights allocated in the same quadrant as long as they aren't culled, even if they're no longer the closest and should be getting a lower quality quadrant if any
Tested versions
Reproducible in Godot v4.3.dev6 and 4.2.2-stable
System information
Godot v4.3.dev6 - Ubuntu 22.04.4 LTS 22.04 - X11 - Vulkan (Forward+) - integrated Intel(R) Graphics (ADL GT2) () - 12th Gen Intel(R) Core(TM) i7-12700H (14 Threads)
Issue description
When creating 33 OmniLight3D objects with shadows that are visible at the same time the nearest lights to the camera are sometimes broken.. I would expect that shadows would be allocated based on camera distance but they seem to get 'stuck'....
I would expect the following behavior:
WORKAROUND:
Adding more texture slots in the shadow atlas avoids this issue by creating enough shadow maps for all the lights.
Steps to reproduce
Load the reproduction project and run it. Notice that some lights are 'off'
Recreating all the lights seems to correct the issue, but that sounds expensive...
![image](https://private-user-images.githubusercontent.com/682658/332567132-cab51adf-44c2-41f7-a479-dd745c85616a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg3Nzc0NTYsIm5iZiI6MTcxODc3NzE1NiwicGF0aCI6Ii82ODI2NTgvMzMyNTY3MTMyLWNhYjUxYWRmLTQ0YzItNDFmNy1hNDc5LWRkNzQ1Yzg1NjE2YS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYxOVQwNjA1NTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT01ZjY0MjkzYWU2NjY0M2U1YjAzNzE2YzkyODNhNmEyOWRlZDJhNmJjNzVkN2ZhNDBiZTBlMmViNjRkY2E4MDA1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.2XWWbRuP7wkVHv-uM4ke3Y9ZRpuTSC1L6Goby0Of8mM)
![ezgif-3-7370b444aa](https://private-user-images.githubusercontent.com/682658/332568455-2cc9791f-b176-4fc5-9848-fc5c2e5ebde7.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg3Nzc0NTYsIm5iZiI6MTcxODc3NzE1NiwicGF0aCI6Ii82ODI2NTgvMzMyNTY4NDU1LTJjYzk3OTFmLWIxNzYtNGZjNS05ODQ4LWZjNWMyZTVlYmRlNy5naWY_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYxOVQwNjA1NTZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05MDE5YjI2ZWNmNjFkODc5OWE3OGM4NzM1ZGY0ZjdhYzg4NzQ0ZGIyN2YzMjhlMGUxN2Y0N2ZjNTZmMjVjM2UxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.nilxlqlhUiFuPPBLIN--5aClM1-d9by_-8PjXH5Qrp0)
Minimal reproduction project (MRP)
many-lights-shadows-broken.zip
The text was updated successfully, but these errors were encountered: