Skip to content

Viewer: bonds poorly visible on a white background #227

Closed

Description

@ohlincha

Reported by Andy (2026-10-04): with the viewer background set to white, bonds are hard to see.

Likely cause: bonds are drawn in the colours of their atoms, so bonds to hydrogen (white) and other light-coloured elements have almost no contrast against white, and thin wireframe/stick bonds have little shading to separate them from the background.

Possible fixes, to decide with the viewer look work (#210, Jmol colours) and the Coin port (#166):

  • a thin dark outline or silhouette on bonds (and atoms), as many molecular viewers use on light backgrounds;
  • adjust colours that are too close to the background (contrast check against the background colour);
  • stronger shading/specular on sticks so their form is visible.

To check first: which display styles are affected (Ball and Stick, Stick, Wireframe), and whether it is the same in the Coin build.

Activity

  1. ohlincha commented on Oct 6, 2026

    @ohlincha
    CollaboratorAuthor

    Narrowed after two rejected attempts (darker bond colours on light backgrounds; a dark outline on bonds and atoms): the colours stay as they are. The problem is the default view: the default style is Ball And Wireframe, which draws bonds as ~1 px GL lines, too thin to read, especially on white. Next: renders of the default view with thicker wireframe lines (2 and 3 px, scaled for HiDPI) against Ball And Stick as the default style, for a decision.

  2. ohlincha commented on Oct 7, 2026

    @ohlincha
    CollaboratorAuthor

    Decided: wireframe bonds become 3 px with line smoothing (scaled for HiDPI). Ball And Stick is to become the default display style once vibration arrows read well in it (today an arrow along a bond is hidden inside the stick); two options for that are being rendered for comparison.

  3. ohlincha commented on Oct 7, 2026

    @ohlincha
    CollaboratorAuthor

    Merged to main (b521d77, merge f7aecc8): wireframe bonds (Ball And Wireframe, Wireframe) now default to 3 px with line smoothing (depth comparison), multiplied by the canvas content scale for HiDPI; saved per-style line widths are read as before (a saved width of 1 equals the old default and was never written, so it now reads as 3). Checked on radium: ctest look_*|guivalues pass (look_offscreen_shading skipped there), tests/apps 29 checked, 0 failures. Before/after renders (ethanol, glycine; white and black background): /home/andy/tmp/ecce/g1-pngs/227-wire3/before-after.png. Ball And Stick arrow options are being rendered next.

  4. ohlincha commented on Oct 7, 2026

    @ohlincha
    CollaboratorAuthor

    Merged to main: Ball And Stick is now the default style (descriptor, atom/fragment/residue constructors, container, viewer fallbacks; a style a user saved still wins, which includes Ball And Wireframe saved on exit by earlier versions). While normal-mode arrows are shown the bond cylinders are drawn at 0.25 of their radius and restored when the arrows are hidden (0.15 erases the bond, 0.4 leaves the shaft half inside the stick; factors: /home/andy/tmp/ecce/g1-pngs/227-bs-arrows/factors.png). New test look_nm_sticks. Radium: look_*/guivalues and tests/apps (29 checked, 0 failures) pass; look_nm_sticks skips there (no Xvfb), passed locally. Default view before/after: /home/andy/tmp/ecce/g1-pngs/227-bs-default/before-after.png. Nothing else remains for this issue.

  5. ohlincha commented on Oct 10, 2026

    @ohlincha
    CollaboratorAuthor

    Related: on a white background the whole molecule looks weak, not only the bonds. See the comment on #210 (faceted spheres, flat shading, white hydrogens on white).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions