-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
projector: draw transparent sprites correctly #5149
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
Isn't it a bit presumptuous to assume everyone uses gmail for git? |
951bc97
to
e26dd88
Compare
e26dd88
to
e4d279d
Compare
@canbakiskan Thanks for the PR! Sorry about the trouble with the CLA bot. |
Thanks for the contribution!
For what it's worth - I haven't tried this myself, but I believe the CLA just requires a Google account, and that account can be associated with non-gmail email addresses. Specifically the page at https://cla.developers.google.com/about says "Ensure you submitted your contribution using one of the email addresses associated with the account you're signed in to" (I'm assuming they mean Google account here; I agree it could be clearer) and links to the page https://security.google.com/settings/email where you can add additional email addresses. So it might be the case that if you added your .edu email address to that account that would satisfy the CLA bot going forward. |
In projector view, when the image sprites are transparent, transparent pixels are not rendered correctly. See images below. This change fixes this rendering issue.
Proper rendering of transparent pixels also allow users to display non-square images as sprites, as long as they pad their image with transparent pixels.
Added a condition to fragment shader that checks if a the texture to be rendered is transparent at that coordinate; if so, it discards the texture.
Before:


After:

Make some pixels in the sprites transparent.
I tried changing the
depthTest
,depthWrite
, andblending
fields ofTHREE.ShaderMaterial
but nothing really worked, either there were z-index issues or transparent pixels were showing up as gray,