-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
SpotLight3D shadows exhibit flickering when moved around. #91976
Comments
It might be worth turning off tighter shadow culling in project settings advanced , rendering lights and shadows, to check whether this is a regression due to tighter culling. If so I can investigate saturday. There is currently a known bug with directional lights in dev6, but spots and omnis no bugs currently reported. |
I can confirm disabling tighter shadow culling stops the flickering |
Just tried this out, it does seem to solve the flickering issue, but apparently tighter shadow caster culling can increase performance, which is exactly what I want. Maybe tighter shadow caster culling could be set separately for each light? Maybe we could add the option's 'flickering' issue in the docs. |
@catboy-catfish Don't worry, this was just to know where the problem started, is not the final solution. As lawnjelly said this will be investigated to make work with tighter shadow culling |
Cool cool, maybe I could make a proposal out of this |
Re-opening as this is not fixed yet. Disabling was to identify the bug, not to fix. |
First step was making a more usable MRP, then converting to 3.x: |
Getting clues now. It seems to be due to the spotlight being attached to the camera, at 0, 0 on the y and z axis. The light position is therefore on the exact boundary for the top and bottom camera frustum planes, and sometimes the distance check is returning +0 and sometimes -0 due to float inaccuracy. This may need an epsilon to prevent this edge condition. UPDATE: Whether borderline frustum planes should be considered back facing is another matter, but this seems more like a question of slightly increasing efficiency, rather than affecting accuracy. I'll make PR soon, I just want to check there aren't any other additions to make it more robust. |
Tested versions
Only tested v4.3.dev6.mono.official [89850d5] and v4.2.2.stable.official [15073af]. Reproducible in v4.3, doesn't seem to be reproducible in v4.2.2.
System information
Godot v4.3.dev6.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1650 (NVIDIA; 31.0.15.5186) - Intel(R) Core(TM) i3-6100 CPU @ 3.70GHz (4 Threads)
Issue description
The shadows from a SpotLight3D start to flicker whenever moved around in 4.3.dev6 official build. The issue can be seen more clearly in the linked video. (There are more files in the video's file browser than there are in the MRP because I didn't delete as much files beforehand.)
2024-05-15.20-18-22.mp4
Steps to reproduce
Minimal reproduction project (MRP)
flickering-shadows-mrp 4.3-dev6.zip
The text was updated successfully, but these errors were encountered: