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

Fix OmniLight/SpotLight shadow opacity calculation #64110

Merged
merged 1 commit into from
Aug 20, 2022

Conversation

Geometror
Copy link
Member

@Geometror Geometror commented Aug 8, 2022

When turning off the shadow property of OmniLight/SpotLight, the shadow was still rendered while the shadow atlas was no longer updated. This PR fixes the shadow opacity calculation so that it behaves the same as for directional lights. There is still some room for improvement, e.g. clear/free the shadow buffer(if possible) but that would require a significantly more complex approach.
Peek 2022-08-08 18-33

Bugsquad edit: This closes #50343.

@Geometror Geometror added this to the 4.0 milestone Aug 8, 2022
@Geometror Geometror requested a review from a team as a code owner August 8, 2022 16:34
@Geometror Geometror force-pushed the fix-light-shadow-off branch from a9ac936 to 9ead777 Compare August 8, 2022 16:36
@jcostello
Copy link
Contributor

Does it fix it for lightmap baking?

@Calinou
Copy link
Member

Calinou commented Aug 8, 2022

Does it fix it for lightmap baking?

I didn't implement shadow_opacity in the lightmapper. I'm not sure how difficult this would be, as lightmapping uses a raytracing approach.
Edit: Issue opened: #64154

If you're referring to #56611, I don't know whether it's a bug or intended behavior. This may be intended behavior to improve performance, while still having shadows for static objects (as they're free at run-time).

@Geometror Geometror force-pushed the fix-light-shadow-off branch from 3223aa5 to 18585c6 Compare August 20, 2022 00:36
Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Calinou Calinou merged commit 0c5f254 into godotengine:master Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vulkan: Disabling shadows for an OmniLight or SpotLight will not apply until the scene is reloaded
4 participants