3Dmol.js icon indicating copy to clipboard operation
3Dmol.js copied to clipboard

per-atom opacity

Open dkoes opened this issue 10 years ago • 4 comments

Currently opacity is per-model, which means we don't have to copy a full array of usually identical opacities to the shader. Should refactor the shaders (with #defines) so there are single-opacity and per-vertex/object (for imposters) opacities and use the appropriate one when opacities are set.

Should probably do something similar for color..

dkoes avatar Apr 11 '16 15:04 dkoes

just making sure, so for example the effect you're looking for is being able to change this uniform "opacity" with a varying one using a directive #impostervaryingopacity when the input for the opacities for the imposter object is an array of values; not a single value. image

bassemhermina avatar Mar 29 '19 01:03 bassemhermina

I mean is the (varying opacity) input coming in an array from a column in the input data like in this form image

bassemhermina avatar Mar 29 '19 01:03 bassemhermina

Basically opacity should be treated like color is being treated. It can already be set differently on individual atoms as part of the style.

dkoes avatar Mar 29 '19 01:03 dkoes

Closing the loop on this one: per-atom sphere opacity landed in #858 and shipped in 3.0.0, along with the in-place coordinate path for trajectories (#859, setFrame(frame, {fast: true})). I think this issue can be closed.

For anyone who wants to see it in use, Probble maps AlphaFold pLDDT onto per-atom opacity and animates on the fast path: https://jaysoma.dev/probble/ (code: https://github.com/jaysoma/Probble). Thanks @dkoes for the reviews.

jaysoma avatar Nov 25 '26 01:11 jaysoma