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

non-physical alpha blending in scatter plot #372

Open
bjudkewitz opened this issue Sep 6, 2022 · 1 comment
Open

non-physical alpha blending in scatter plot #372

bjudkewitz opened this issue Sep 6, 2022 · 1 comment

Comments

@bjudkewitz
Copy link

bjudkewitz commented Sep 6, 2022

When I create a 3d scatter plot of points with alpha<1 (can be 0.99), there are perspectives from which background points are shown in front of foreground points (see screenshot, generated with code below; note that all spheres have the same size, so the larger one should be in the foreground). Switching to alpha = 1 fixes the problem, but that prevents me from using alpha.

Screenshot 2022-09-06 at 17 34 19

import k3d
import numpy as np
coords0 = np.random.randn(20,3)
plot = k3d.plot()
plot.background_color = 0
plot.grid_visible=False
points = k3d.points(positions=coords0,point_size=1, shader='3d', color_range=[0, 1]) 
points.opacity = 0.99
plot += points
plot.display()

python and js version: 2.14.5
Client: mac firefox
Server: ubuntu linux

@artur-trzesiok
Copy link
Collaborator

Hi!

It's well know limitations in 3d graphics called "order independent transparency". There is couple techniques to solved it. I have it already in k3dpro version (non open-source one) and it seems to be stable. I used depth peels method.

Thanks for that issue. Please obseve tasks with label "order independent transparency" here.

@artur-trzesiok artur-trzesiok self-assigned this Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants