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

Clear specular buffer if sky mode is canvas and screen space effects are used #78624

Merged

Conversation

puchik
Copy link
Contributor

@puchik puchik commented Jun 23, 2023

Canvas background mode does not clear the color buffer, but copies over it. If screen-space specular effects are enabled and the background is blank, this would result in ghosting due to the separate specular buffer copy. Need to explicitly clear the specular buffer once we're done with it to fix it.

Closes #76044

Animation

(Note, this fixes the artifacting when resizing the window mentioned in that issue, too, but only once resizing is stopped. Previously, the flashing and artifacts would remain after resizing was finished. Now at least it's cleared once the window stops moving. Still, this PR does fix the original issue and logically makes sense. That other bug should probably be a separate issue and PR as the cause seems to be different.)

Explicitly clear the separate specular buffer when the background mode is canvas and screen space effects (and thus a separate specular buffer) are used.
@puchik puchik requested a review from a team as a code owner June 23, 2023 19:42
@YuriSizov YuriSizov added this to the 4.2 milestone Jun 23, 2023
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

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

It is kind of a pain to have to open a draw list to do this. But we don't have an easy way to clear one texture in a framebuffer when opening a render pass, so this is the best solution for now.

@YuriSizov
Copy link
Contributor

@clayjohn Should we cherry-pick this to 4.1?

@clayjohn clayjohn added the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Jul 7, 2023
@clayjohn
Copy link
Member

clayjohn commented Jul 7, 2023

@clayjohn Should we cherry-pick this to 4.1?

Sure!

@akien-mga akien-mga merged commit ea3aaea into godotengine:master Jul 8, 2023
@akien-mga
Copy link
Member

Thanks!

@puchik puchik deleted the canvas-background-specular-ghosting branch July 8, 2023 17:26
@puchik puchik restored the canvas-background-specular-ghosting branch July 8, 2023 17:26
@YuriSizov YuriSizov removed the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Jul 10, 2023
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.1.1.

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.

Enabling SSR with a Canvas Sky creates ghosting on any element in the environment (but not on macOS)
4 participants