-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
PCSS not working for SpotLight3D: Vulkan (Forward+) #80137
Comments
I can confirm this on 4.2.dev 41a7f6b (Linux, GeForce RTX 4090 with NVIDIA 535.54.03). |
I don't think anyone has started working on this, so feel free to open a PR 🙂 |
Maybe the problem lies in the different data and shader used to render shadow between omni light and spot light. CPU side calculation:
For omni light, the calculation is But for spot light,
the calculation essentially equals to In the example provided, let's say origin soft_shadow_size is 0.5 , rect.size.width is 0.25, radius is 5, and so the final result is 0.0125 ( (the value of soft_shadow_sizein this case is 0.5 in omni light). But I'm a little confused about the formula above, and git blame doesn't tell me about why we use the formula above for spot light's light_size. I can understand why multiply by rect.size.width as we need it in uv space. GPU sideCheck light_data_inc.glsl, it says 'for spot, soft_shadow_size is the size in uv coordinates of the light, for omni it's the span angle'. to be continued... |
Godot version
Godot v4.1.stable
System information
Godot v4.1.stable - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Ti (NVIDIA; 31.0.15.2824) - 11th Gen Intel(R) Core(TM) i5-11600K @ 3.90GHz (12 Threads)
Issue description
Percentage-closer soft shadows (PCSS) don't seem to be working correctly with SpotLight3d's.
Image below shows an Omni Light and Spot Light with the same light_size value. The Omni Light shows correct PCSS with the shadow getting softer the furth the object (caster) is from the surface (reciever). The Spot Light shows uniform shadow hardness.
Increasing the light_size Value for a Spot Light uniformly blurs the shadow, but the blur doesn't seem impacted by the casters distance from the receiver.
Steps to reproduce
Minimal reproduction project
PCSS_Shadow_Issue.zip
The text was updated successfully, but these errors were encountered: