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

Enabling transparent webgl draws for scatter3d trace when colors are transparent #3496

Merged
merged 4 commits into from
Feb 6, 2019

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Jan 30, 2019

Fix #3492
3D Scatter transparency not activated by marker.color or marker.line.color as well as line.color and errorbars alpha channel.
This is fixed here by patching gl-vis modules.
@plotly/plotly_js

…lors

added a baseline to lock bug issue 3492

one new baseline change

correct baseline

fixup
@etpinard
Copy link
Contributor

Hmm. How does this relate to #3138 ?

@archmoj
Copy link
Contributor Author

archmoj commented Jan 31, 2019

Hmm. How does this relate to #3138 ?

Good call.
This PR does not touch gl-mesh3d opacity issues. There is actually another PR on gl-mesh3d repository related to volume trace.
But yeah as discussed we may improve opacity in gl-vis modules in other PRs next.

@archmoj
Copy link
Contributor Author

archmoj commented Feb 5, 2019

@etpinard are you interested to include this in 1.44.3?

@etpinard
Copy link
Contributor

etpinard commented Feb 5, 2019

I'm confused by your answer in #3496 (comment)

Have you done any before/after benchmarking?

@archmoj
Copy link
Contributor Author

archmoj commented Feb 5, 2019

OK. In this PR we only activated the alpha rendering channels for those 3 gl-vis modules in case of colors being in rgba format with any alpha less than 1.
If the colors were passed in rgb or they all have alpha equal 1 the alpha channel won't be activated.
Yes I could do a bench-marking next.

@archmoj
Copy link
Contributor Author

archmoj commented Feb 6, 2019

Before codepen.
After codepen.
Both gave me around 1025ms for 10K points.
However; the improvements in the quality of graphs are notable when rotating or zooming in.
Hope it may help.

@etpinard
Copy link
Contributor

etpinard commented Feb 6, 2019

Hmm. Are those markers really transparent:

image

?

@archmoj
Copy link
Contributor Author

archmoj commented Feb 6, 2019

I think some of them are transparent.
Here is the same codepen with fewer points and large markers.

@etpinard
Copy link
Contributor

etpinard commented Feb 6, 2019

Ha I see, this is "opacity" from the "a" in rgba. So we're not talking about "true" opacity but "whitening" opacity (see https://github.com/plotly/phoenix-integration/issues/10#issuecomment-164824843 for a past discussion on the topic).

This PR seems like an ok fix for #3492 🎉

I do have one question for @archmoj in -> gl-vis/gl-scatter3d#16 (comment)

@etpinard
Copy link
Contributor

etpinard commented Feb 6, 2019

Cool. 💃

Let's get this in for 1.44.3 !

@archmoj archmoj merged commit d958279 into master Feb 6, 2019
@archmoj archmoj deleted the fix3492-enable-opacity-by-alpha-fin branch February 6, 2019 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
2 participants