You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Add scene.oit to blend translucent scatter3d markers by depth #23
On upstream main, translucent scatter3d markers blend in the order of the draws, not by depth. The last trace lies on top from every camera angle, even where its markers sit behind the others (plotly#1267, and the closed duplicate plotly#6536). Inside one trace, the order of the points decides in the same way.
We propose scene.oit with the values 'off' (default) and 'auto'. With 'auto', the scene draws translucent markers with order-independent transparency. Each fragment adds its optical depth to a few depth nodes of its pixel. A second pass weights each color by the transmittance in front of it. Every draw adds, so the order of the draws has no effect, and nothing sorts.
A nearer marker still covers a farther one. The default changes no pixel.
Why should this feature be added?
Translucent markers are the usual way to show density in a large point cloud. Today, what shows in front depends on the order of the traces, not on the camera. A reader cannot tell which group lies in front.
AnnZarro, a viewer for single-cell data, motivates this request.
Mocks/Designs
Two linked rings of translucent points, red drawn first. Left, upstream main: blue covers red at the two crossings. Right, the intended result: each ring lies in front at one crossing.
Notes
The change needs changes in gl-plot3d (the render passes) and gl-scatter3d (the marker shaders). We would open pull requests there together with the plotly.js pull request, and pin the fork commits until a release of the two packages.
The maintainer archmoj worked on this problem before: the gl-plot3d branch gl3d-blend-rebase (2019) and the gl-scatter3d branch correct-transparency (2020). Thank you for that work.
This change is one part of a larger set for large point clouds in scatter3d and scattergl. We collected the set in a draft on our fork: #11. To keep your queue small, we start with this one. We are happy to file issues for the other parts if they interest you.
We can adapt the name, or change the approach.
Contribution
I want to open a pull request for this issue after it gets the ready-for-pr label
I can review or test a pull request from someone else
Activity