-
-
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
Add support for soft shadows to the GPU lightmapper #62054
Add support for soft shadows to the GPU lightmapper #62054
Conversation
I tested this PR locally, it's looking good 🙂 The PCSS shadow blur between real-time and baked shadows seems to be a close match in the default configuration. The only issue I could notice is that the Light3D's Shadow Blur property isn't taken into account to increase/decrease the shadow blur (even after baking lightmaps again). Also, constant shadow blur (when size = 0.0 and blur > 0.0) isn't supported, but I suppose this is outside the scope of this PR. I suggest multiplying the shadow blur in the lightmapper by the Shadow Blur property. This would allow for a better matching between real-time and baked shadows when Shadow Blur is modified from its default value (1.0). Testing project: test_lightmap_shadow_blur.zip Shadow Blur = 1.0Shadow Blur = 2.0 |
Updated the PR to respect the Shadow Blur property. Needs testing. |
In the regular scene shader, we still take the godot/servers/rendering/renderer_rd/shaders/scene_forward_lights_inc.glsl Lines 503 to 517 in f3bf033
For directional light when angular diameter == 0
Overall, I'm not sure we need to have blur when Angular Distance is 0. Blur is present in the default PCF path for shadows in order to hide pixelation artifacts from using low resolution shadowmaps. For lightmaps, we can get proper hard shadows that look really nice, so the blurring is less beneficial |
This is only true if bicubic sampling is used, which is not the case in That said, I agree that contact hardening (PCSS) is preferable to constant blur when using fully baked lights. |
5d589b1
to
e995764
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you for your hard work
Thanks! |
master
port of #50184.Closes #52199.
Results
Directional Light
size = 10deg
)Spot Light
w/o soft shadows
w/ soft shadows (
size = 1m
)Omni Light
w/o soft shadows
w/ soft shadows (
size = 1m
)