ngl icon indicating copy to clipboard operation
ngl copied to clipboard

Problem when transparent representations overlap

Open d-beltran opened this issue 4 years ago • 3 comments

Hi :)

I observed that when you look through a transparent (opacity < 1) representation you may not see other transparent representations. This happens even if the closest representation has opacity 0 and the farthest has 0.9

You can observe this in the NGL gallery example called 'component/structure-biomol'

As you can see in the image below, the orange mesh is making disappear everything behind. Captura de pantalla de 2021-03-11 17-31-31 Then if I move the camera slightly it is the red mesh which makes everything disappear Captura de pantalla de 2021-03-11 17-30-58

In my personal case this is being a mess, since the transparent representation is a big surface. PVm45GQDp6

Is there any trick to handle this?

Thank you so much

d-beltran avatar Mar 11 '21 17:03 d-beltran

Duplicate of #552 (unfortunately, I don't think this is easily fixable - @arose may be able to comment - I think molstar gets this right?)

fredludlow avatar May 12 '21 15:05 fredludlow

I see. Thanks for your reply :)

It won't be easy changing to molstar since NGL is deeply integrated in our project, but I think one day we will have to.

As a workaround, I'm using the parameter 'background: true' when I have to represent a surface with opacity < 1:

1yp0J0oHYp

d-beltran avatar May 13 '21 08:05 d-beltran

You can try to toggle the depthWrite representation parameter off. This may help a bit but will produce other artifacts. In molstar we essentially solved this, see https://github.com/molstar/molstar/issues/83#issuecomment-739452292.

arose avatar May 15 '21 18:05 arose