Opened 8 years ago

Closed 5 years ago

Last modified 5 years ago

#859 closed defect (fixed)

silhouettes on top of labels

Reported by: Elaine Meng Owned by: Tom Goddard
Priority: major Milestone:
Component: Graphics Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

Even though the labels are on top (default) the silhouettes are drawn over them. Image attached.

Attachments (1)

Screen Shot 2017-09-28 at 4.03.51 PM.png (102.5 KB ) - added by Elaine Meng 8 years ago.

Download all attachments as: .zip

Change History (7)

by Elaine Meng, 8 years ago

comment:1 by Tom Goddard, 8 years ago

Even weirder, if a 3d label is created with onTop false then the label rectangle shows a silhouette outline.

These two problems are because the 3d label onTop option is implemented with a simple but not quite adequate trick of rendering the label while ignoring the depth buffer glDisable(GL_DEPTH_TEST) and also not writing to the depth buffer. Combine that with the fact that silhouettes do not have a depth in the current implementation and behave like an overlay means that in onTop mode the 3d labels create no silhouettes and underlying silhouettes are drawn on top of the label. In onTop false mode, the label rectangle itself shows a silhouette since there is no provision to suppress silhouettes for a 3d model.

2D labels don't have these problems.

The most obvious fix is that 3D labels with onTop true should be rendered as an overlay. Unfortunately that requires totally different rendering code, so to support onTop true and onTop false would require two completely different rendering modes. I don't think the complexity of that is worth it.

Another possible solution is to assign depth to the silhouettes so they pass under the label. But that will not work with the current trick where the label simply ignores the depth. A basic problem is that the silhouette is drawn after the label is drawn and both are ignoring the depth buffer.

Another solution is to remove the onTop option, only allow onTop true and reimplement rendering as an overlay.

in reply to:  3 comment:2 by Elaine Meng, 8 years ago

It may not be that bad in itself, although I was initially surprised.  The main effect is to make the labels look slightly transparent.  It was also more obvious in my specific example because the labels were in a fat/large font.

comment:3 by Tom Goddard, 8 years ago

The bad silhouette appearance with onTop false and with onTop true are two different problems. The "onTop false" case where the label rectangle shows a silhouette is caused by the fact that there is no way to suppress a silhouette selectively on some models. The basic problem here is that silhouettes are not a separate draw pass, they only use the depth buffer. This makes them fast to render but means you can't choose to put silhouettes on only some models. Using a separate draw pass is what Chimera does, is slow, but can allow silhouettes on only some models. We could conceivably support both slow methods and fast methods -- but more complexity.

The onTop true problem is because neither silhouettes nor 3d labels are assigned depth and silhouettes are always drawn after the models so end up on top.

comment:4 by Tom Goddard, 5 years ago

Resolution: fixed
Status: assignedclosed

This was fixed maybe a year ago, possibly more. On top labels are now drawn after silhouettes so the labels are on top of the silhouettes.

in reply to:  6 comment:5 by Elaine Meng, 5 years ago

Is it a bug that "label onTop f" does not change existing labels?  The onTop option is ignored unless you are adding new labels.  At least according to the documentation it is supposed to change existing labels.  I can make a separate ticket if it's a bug and you want a separate ticket.

in reply to:  7 ; comment:6 by goddard@…, 5 years ago

Sounds like a bug to me.  Please do make a ticket.

Note: See TracTickets for help on using tickets.