-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Merged by Bors] - use alpha mask even when unlit #6047
Conversation
this also causes the alpha channel to be forced to 1.0 for unlit+opaque so it's not a raw passthrough of the input value any more. i think that's fine though, i can't see a good reason to use opaque with an alpha < 1.0. for unlit+blend the behaviour will be unchanged, and for unlit+mask the alpha will be 0 or 1 as expected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors r+
# Objective - Alpha mask was previously ignored when using an unlit material. - Fixes #4479 ## Solution - Extract the alpha discard to a separate function and use it when unlit is true ## Notes I tried calling `alpha_discard()` before the `if` in pbr.wgsl, but I had errors related to having a `discard` at the beginning before doing the texture sampling. I'm not sure if there's a way to fix that instead of having the function being called in 2 places.
Build failed: |
@IceSentry this PR needs to be updated with latest main and the spawn bundle changes |
c957cd3
to
35efe59
Compare
Done. |
bors r+ |
# Objective - Alpha mask was previously ignored when using an unlit material. - Fixes #4479 ## Solution - Extract the alpha discard to a separate function and use it when unlit is true ## Notes I tried calling `alpha_discard()` before the `if` in pbr.wgsl, but I had errors related to having a `discard` at the beginning before doing the texture sampling. I'm not sure if there's a way to fix that instead of having the function being called in 2 places.
Pull request successfully merged into main. Build succeeded: |
# Objective - Alpha mask was previously ignored when using an unlit material. - Fixes bevyengine#4479 ## Solution - Extract the alpha discard to a separate function and use it when unlit is true ## Notes I tried calling `alpha_discard()` before the `if` in pbr.wgsl, but I had errors related to having a `discard` at the beginning before doing the texture sampling. I'm not sure if there's a way to fix that instead of having the function being called in 2 places.
# Objective - Alpha mask was previously ignored when using an unlit material. - Fixes bevyengine#4479 ## Solution - Extract the alpha discard to a separate function and use it when unlit is true ## Notes I tried calling `alpha_discard()` before the `if` in pbr.wgsl, but I had errors related to having a `discard` at the beginning before doing the texture sampling. I'm not sure if there's a way to fix that instead of having the function being called in 2 places.
# Objective - Alpha mask was previously ignored when using an unlit material. - Fixes bevyengine#4479 ## Solution - Extract the alpha discard to a separate function and use it when unlit is true ## Notes I tried calling `alpha_discard()` before the `if` in pbr.wgsl, but I had errors related to having a `discard` at the beginning before doing the texture sampling. I'm not sure if there's a way to fix that instead of having the function being called in 2 places.
Objective
Solution
Notes
I tried calling
alpha_discard()
before theif
in pbr.wgsl, but I had errors related to having adiscard
at the beginning before doing the texture sampling. I'm not sure if there's a way to fix that instead of having the function being called in 2 places.