Opened 4 years ago
Closed 4 years ago
#4797 closed defect (fixed)
tether opacity visually incorrect
Reported by: | pett | Owned by: | Tom Goddard |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | Depiction | Version: | |
Keywords: | Cc: | Elaine Meng | |
Blocked By: | Blocking: | ||
Notify when closed: | Platform: | all | |
Project: | ChimeraX |
Description
When I position a tether with something behind it, if the tether shape is cone or reverse cone, the opacity is effective 95% or higher despite nominally be 50% -- you basically can't see through it. If the tether shape is cylinder, then the opacity seems correct, I can see both the tether and what's behind it.
Some kind of artifact of how cones are drawn? Maybe the normals are facing inward or something?
Attachments (1)
Change History (2)
by , 4 years ago
Attachment: | tether.cxs added |
---|
comment:1 by , 4 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed (kind of).
The problem is that the cone normal vectors get distorted by the instancing transforms that stretch the cone much more along its axis than it does in the perpendicular direction. This makes the normals nearly parallel to the cone surface. Due to angle-dependent transparency this makes the opacity much higher, as if you are looking through the cone surface nearly perpendicular to the surface (so it is effectively thicker).
The bottom line is instancing with stretching transforms does not play nice with the normal vectors. There is no easy way to fix that. The graphics would need to handle the scaling separate from the rotation when placing the cones and that would require large changes with poor performance to handle a rare case. So I opted to hack things slightly and make the tether normal vectors point radially away from the cone axis, just like a cylinder. When the cone gets stretched along its axis the normals don't get stretched since they have zero component along the axis. So the transparency looks mostly right. The wrong normals also effect the appearance of lighting on an opaque tether, but with this change they are closer to being right.
A session with an example tether with a bond behind it