Comments (2)
That's an inherent problem of the way opacity is implemented. When a transparent triangle gets rendered before something that is behind it, the triangle behind does not get rendered, because it fails the Z-test. To solve this with the current method, all the triangles would have to be sorted by projected Z-coordinates and that's relatively expensive in JavaScript. Another option is to implement per-object opacity as a post-processing pass.
I've added a small fix for the case where an the objects is completely transparent. That doesn't solve the visual artifacts when multiple objects are semi-transparent. To somewhat lessen the problems, we could order the objects such that the most opaque gets rendered first. When setting the opacity you could do the following(untested):
var alpha = 0.5;
obj.setOpacity(alpha);
obj.order(10 - alpha * 10);
viewer._objects.sort(function(lhs, rhs) {
return lhs.order() - rhs.order();
});
from pv.
Thanks, that works well, and is better than the binary on/off switch we were using. I notice that if option outline is true, then for 0 opacity, the object is drawn black. If outline is false, then the object is not visible at opacity 0 as expected.
from pv.
Related Issues (20)
- Any way to visually make certain bonds stronger? HOT 2
- Dead contribution guidelines link in readme.md HOT 1
- Uncaught TypeError: Cannot read property 'centralAtom' of undefined
- Disabling zoom on scroll
- Support MMTF format
- HETATM and Organic sticks HOT 1
- If a trace has a length of 1, it may not render properly
- atom has no _residue
- package.json main points to non-existent file
- Partial coloring of structure HOT 3
- CIAO MARCO!!! PROBLEMI CON APERTURA PDB FILES
- Structure creation by hand HOT 1
- project still alive? HOT 3
- Coloring each residue by a hex code color HOT 1
- Suggestion: Make bio-pv a web component HOT 2
- I AM NEW
- Display problem of structure of alphafold2 HOT 6
- How to select all residues within radius of mouse click? HOT 6
- Inquiry support drawing a path from one residue to another residue HOT 9
- Using Python CGI to create PV instances on the fly HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pv.