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

Allow customizing the blend function #227

Open
SludgePhD opened this issue Sep 17, 2023 · 0 comments
Open

Allow customizing the blend function #227

SludgePhD opened this issue Sep 17, 2023 · 0 comments
Labels
A - components Change related to an ECS component A - internal Internal change on a core system C - enhancement New feature or request

Comments

@SludgePhD
Copy link
Contributor

Describe the solution you'd like
bevy_hanabi currently uses standard non-premultiplied alpha blending to draw all particles. It would be nice if that blend function was configurable instead of being hard-coded.

Describe why you want that solution. Is this related to a problem?
I'm rendering my scene onto a transparent canvas, which is then blended onto the window. For that to look right, transparent objects need to use premultiplied alpha blending.

Describe alternatives you've considered
Deal with the graphical artifacts. This is what I'm doing now.

Additional context
Here's a smoke effect with my current setup. Above the line, the particles get drawn onto the transparent canvas, below the line, they get drawn onto an opaque sprite. There's a clearly visible seam in the particles that shouldn't be there.
screenshot_2023-09-17_17:28:30

I see that hanabi already supports alpha masking, and bevy's PBR pipeline supports alpha masking via the material's AlphaMode. Perhaps that type could be reused here?

@djeedai djeedai added C - enhancement New feature or request A - internal Internal change on a core system A - components Change related to an ECS component labels Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A - components Change related to an ECS component A - internal Internal change on a core system C - enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants