-
-
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
Fixed sprite transparency artifacts #2428
Conversation
@@ -20,5 +20,7 @@ void main() { | |||
sampler2D(ColorMaterial_texture, ColorMaterial_texture_sampler), | |||
v_Uv); | |||
# endif | |||
if(color.a < 0.5) discard; |
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.
I believe I read somewhere that discard
hurts performance.
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.
This is hardware dependent (source). In any case, the performance hit shouldn't be noticeable.
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.
Why a cutout value of 0.5? Isn't that high?
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.
That's the "standard" default value from my experience. I'm looking into making it customisable, but we'll see if time permits.
I think this is a good solution for sprites where 1 bit alpha is desired, as this allows them to use the shading path for opaque geometry. |
@TheArchitect4855 could you please comment in #2373 :) I'm tackling the backlog, and this PR is from before then. |
Objective
Solution