Skip to content

Allow clearing backbuffer after finishing CanvasGroup#67051

Merged
akien-mga merged 1 commit into
godotengine:masterfrom
clayjohn:CanvasGroup-clear
Oct 8, 2022
Merged

Allow clearing backbuffer after finishing CanvasGroup#67051
akien-mga merged 1 commit into
godotengine:masterfrom
clayjohn:CanvasGroup-clear

Conversation

@clayjohn

@clayjohn clayjohn commented Oct 7, 2022

Copy link
Copy Markdown
Member

Fixes: #60301 (comment)

Previously we would mark the backbuffer as having been cleared once it was cleared so we wouldn't have to clear it multiple times. But we need to clear it multiple times if we are going to reuse it for a subsequent CanvasGroup.

This PR fixes the bug by resetting the backbuffer_cleared bool once a CanvasGroup has finished drawing flagging that the backbuffer can be cleared again if needed.

Before:

Screenshot from 2022-10-07 14-14-41

After:

Screenshot from 2022-10-07 14-14-06

This avoids an issue where having multiple CanvasGroups overlap
would create a weird artifact
@clayjohn clayjohn added this to the 4.0 milestone Oct 7, 2022
@clayjohn clayjohn requested a review from a team as a code owner October 7, 2022 21:19
@akien-mga

Copy link
Copy Markdown
Member

Thanks!

@clayjohn clayjohn deleted the CanvasGroup-clear branch October 9, 2022 07:41
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.

Only one CanvasGroup can be used per layer

2 participants