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

projector: draw transparent sprites correctly #5149

Merged
merged 1 commit into from
Jul 22, 2021

Conversation

canbakiskan
Copy link
Contributor

@canbakiskan canbakiskan commented Jul 22, 2021

  • Motivation for features / changes

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.

  • Technical description of changes

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.

  • Screenshots of UI changes

Before:
before1
before2

After:
after

  • Detailed steps to verify changes work correctly (as executed by you)

Make some pixels in the sprites transparent.

  • Alternate designs / implementations considered

I tried changing the depthTest, depthWrite, and blending fields of THREE.ShaderMaterial but nothing really worked, either there were z-index issues or transparent pixels were showing up as gray,

@google-cla
Copy link

google-cla bot commented Jul 22, 2021

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 @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label Jul 22, 2021
@google-cla
Copy link

google-cla bot commented Jul 22, 2021

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.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@canbakiskan
Copy link
Contributor Author

canbakiskan commented Jul 22, 2021

It doesn't accept my CLA acceptance because I can only sign it with my gmail address which is different from my regular email address I have on record. No idea how to resolve it, can't edit the email address in the signing area of CLA. Ok, changed commit email address.

Isn't it a bit presumptuous to assume everyone uses gmail for git?

@canbakiskan canbakiskan force-pushed the projector-transparent branch from 951bc97 to e26dd88 Compare July 22, 2021 08:52
@google-cla google-cla bot added cla: yes and removed cla: no labels Jul 22, 2021
@canbakiskan canbakiskan force-pushed the projector-transparent branch from e26dd88 to e4d279d Compare July 22, 2021 09:11
@bileschi
Copy link
Collaborator

@canbakiskan Thanks for the PR! Sorry about the trouble with the CLA bot.

@bileschi bileschi self-requested a review July 22, 2021 14:28
@nfelt
Copy link
Contributor

nfelt commented Jul 22, 2021

Thanks for the contribution!

Isn't it a bit presumptuous to assume everyone uses gmail for git?

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants