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

Opacity issues #574

Closed
Jellby opened this issue Dec 9, 2017 · 3 comments
Closed

Opacity issues #574

Jellby opened this issue Dec 9, 2017 · 3 comments

Comments

@Jellby
Copy link

Jellby commented Dec 9, 2017

It is common to see artifacts in translucent object in any 3D rendering software, but I wonder if there is something that could be done to alleviate them in Mayavi. I took the "atomic orbital" example, added opacity=0.8, and this more or less shows the issue, as I slightly tilt the object from left to right:
snapshot2
The center figure shows obvious artifacts, but it is also clear (at least when seeing it "live") that there is something wrong in the right figure: for instance, the pink-blue part of the surface should stay at the top right, and not the top left.

I also see things similar to this, and it is suggested that "depth peeling" could help. Can I enable it with Mayavi? How?

@larsoner
Copy link
Contributor

larsoner commented May 2, 2018

I tried for a while to get depth peeling to work by digging into tvtk and even vtk itself but was never able to. :(

@prabhuramachandran
Copy link
Member

I tried this:

s = mlab.pipeline.surface(contour2, colormap='hsv', opacity=0.8)
s.scene.renderer.use_depth_peeling = True

And it seems to look pretty good to me with VTK 8.1.1. Also you could try increasing

s.scene.renderer.maximum_number_of_peels = 8

I am unable to reproduce this so am closing this for now. Please reopen if you are running into issues.

@larsoner
Copy link
Contributor

I can confirm that changing s.scene.renderer.use_depth_peeling does change behavior on my system (macOS, VTK 8.1.0)

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

No branches or pull requests

3 participants