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 ClearColor in 2d pipelines #13378

Merged
merged 5 commits into from
May 15, 2024

Conversation

pietrosophya
Copy link
Contributor

@pietrosophya pietrosophya commented May 15, 2024

Objective

Solution

  • Even if the number of renderables is empty, the transparent phase need to run to set the clear color.

Testing

  • Tested on the clear_color example

@alice-i-cecile alice-i-cecile added this to the 0.14 milestone May 15, 2024
@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen labels May 15, 2024
@alice-i-cecile alice-i-cecile mentioned this pull request May 15, 2024
13 tasks
@JMS55
Copy link
Contributor

JMS55 commented May 15, 2024

Why transparent, and not opaque? This is also unfortunate because render passes cost a good amount of performance, although for 2d it shouldn't matter too much.

@IceSentry
Copy link
Contributor

Why transparent, and not opaque?

Because not enough people have reviewed my opaque 2d work yet #13069

@alice-i-cecile
Copy link
Member

This appears to have the same root cause as #13383. @IceSentry is working on a fix.

@IceSentry
Copy link
Contributor

@alice-i-cecile this is the only fix needed, so this can be merged

@IceSentry
Copy link
Contributor

IceSentry commented May 15, 2024

The real fix will be to have an opaque pass, but that's a lot more work since my PR I shared above needs a ton more work on top of it.

@IceSentry IceSentry added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label May 15, 2024
@IceSentry
Copy link
Contributor

Actually, @pietrosophya could you add the if !transparent_phase.items.is_empty() check around the transparent_phase.render(&mut render_pass, world, view_entity); line? That would be more correct.

Like this:

if !transparent_phase.items.is_empty() {
	transparent_phase.render(&mut render_pass, world, view_entity);
}

Realistically, it doesn't really matter because that means it's just running an empty scene anyway, but it still makes a bit more sense.

@alice-i-cecile alice-i-cecile enabled auto-merge May 15, 2024 20:25
auto-merge was automatically disabled May 15, 2024 20:25

Head branch was pushed to by a user without write access

@pietrosophya
Copy link
Contributor Author

Done! 😉

@alice-i-cecile alice-i-cecile enabled auto-merge May 15, 2024 20:25
@alice-i-cecile
Copy link
Member

Awesome, thank you all very much! Nice to clean up one of the larger open bugs in the milestone.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue May 15, 2024
Merged via the queue into bevyengine:main with commit d17fb16 May 15, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gizmos drawing despawned entities Setting ClearColor doesn't work
4 participants