-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Unlit materials don't seem to respect AlphaMode::Mask #4479
Labels
Comments
JohnEmhoff
added
C-Bug
An unexpected or incorrect behavior
S-Needs-Triage
This issue needs to be labelled
labels
Apr 15, 2022
alice-i-cecile
added
A-Rendering
Drawing game state to the screen
and removed
S-Needs-Triage
This issue needs to be labelled
labels
Apr 16, 2022
This issue has been causing me quite a bit of grief recently, I imagine the issue however is within the standard shader. I may have a look later but my shader knowledge is very hit and miss. |
bors bot
pushed a commit
that referenced
this issue
Sep 28, 2022
# 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.
james7132
pushed a commit
to james7132/bevy
that referenced
this issue
Oct 19, 2022
# 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.
james7132
pushed a commit
to james7132/bevy
that referenced
this issue
Oct 28, 2022
# 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.
ItsDoot
pushed a commit
to ItsDoot/bevy
that referenced
this issue
Feb 1, 2023
# 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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bevy version
0.6.1
Operating system & version
Ubuntu 21.10
What you did
Using a
StandardMaterial
withunlit: true
seems to ignoreAlphaMode::Mask
.I'm rendering a reticle as a cube with a mostly transparent texture. Using this material:
...renders like this:
But using this material:
...renders like this:
What you expected to happen
The black area in the latter image should be transparent. For whatever reason
AlphaMode::Blend
does work with both lit and unlit, but it has the side effect of messing with depth ordering. (This is reasonable, right? It doesn't seem crazy that when blending nothing writes to the depth buffer)What actually happened
unlit: true
causesAlphaMode::Mask
to be ignoredAdditional information
It's entirely possible this is behaving as expected for some interesting reason that I'm just not aware of. If so I apologize and appreciate the opportunity to learn something :)
The text was updated successfully, but these errors were encountered: