Opened 5 years ago

Last modified 4 years ago

#4541 assigned defect

Silhouettes look wrong

Reported by: jmeyerow@… Owned by: Tom Goddard
Priority: normal Milestone:
Component: Graphics Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

The following bug report has been submitted:
Platform:        macOS-10.16-x86_64-i386-64bit
ChimeraX Version: 1.3.dev202104160519 (2021-04-16 05:19:01 UTC)
Description
When enabling Silhouettes for a volume, there appear many extra black lines/shapes both in the rendering and in any image file types saved from the current view. This happens both in the latest stable build and this daily build.

Log:
UCSF ChimeraX version: 1.3.dev202104160519 (2021-04-16)  
© 2016-2021 Regents of the University of California. All rights reserved.  
How to cite UCSF ChimeraX  

> open
> /Users/justin/Documents/FARM/Writing/2021/OTRmanuscript/chimerafigures/cryosparc_P50_J491_005_volume_map_sharp.mrc

Opened cryosparc_P50_J491_005_volume_map_sharp.mrc as #1, grid size
320,320,320, pixel 0.852, shown at level 0.397, step 2, values float32  

> volume #1 step 1

> volume #1 level 1.034

> lighting simple

> lighting soft

> graphics silhouettes true

> set bgColor white

> volume #1

> volume #1 color #b2b2b2f9

> volume #1 color #b2b2b2a3

> volume #1 level 0.5353

> volume #1 level -1.707

> volume #1 level 0.07

> volume #1 level 0.04

> 123angle

123angle is provided by the uninstalled bundle SEQCROW  

> volume #1 level 0.1

> volume #1 level 0.5

> graphics silhouettes false

> volume #1 level 1.33

> volume #1 level 1.137

> lighting shadows true intensity 0.5

> lighting soft

> lighting shadows true intensity 0.5

> graphics silhouettes true

> graphics silhouettes false

> lighting simple

> ui tool show "Hide Dust"

> surface dust #1 size 5.11

> graphics silhouettes true

> graphics silhouettes false

> volume #1 color #9d92bfa3

> volume #1 color #665f7da3

> volume #1 color #665f7d61

> volume #1 color #665f7d61

> save
> /Users/justin/Documents/FARM/Writing/2021/OTRmanuscript/chimerafigures/volumesiltest.tif
> width 864 height 825 supersample 3

> graphics silhouettes true

> save
> /Users/justin/Documents/FARM/Writing/2021/OTRmanuscript/chimerafigures/volumesilh.tif
> width 864 height 825 supersample 3




OpenGL version: 4.1 INTEL-16.1.7
OpenGL renderer: Intel(R) Iris(TM) Plus Graphics OpenGL Engine
OpenGL vendor: Intel Inc.Hardware:

    Hardware Overview:

      Model Name: MacBook Pro
      Model Identifier: MacBookPro16,2
      Processor Name: Quad-Core Intel Core i7
      Processor Speed: 2.3 GHz
      Number of Processors: 1
      Total Number of Cores: 4
      L2 Cache (per Core): 512 KB
      L3 Cache: 8 MB
      Hyper-Threading Technology: Enabled
      Memory: 32 GB
      System Firmware Version: 1554.60.15.0.0 (iBridge: 18.16.13030.0.0,0)

Software:

    System Software Overview:

      System Version: macOS 11.1 (20C69)
      Kernel Version: Darwin 20.2.0
      Time since boot: 11 days 15:12

Graphics/Displays:

    Intel Iris Plus Graphics:

      Chipset Model: Intel Iris Plus Graphics
      Type: GPU
      Bus: Built-In
      VRAM (Dynamic, Max): 1536 MB
      Vendor: Intel
      Device ID: 0x8a53
      Revision ID: 0x0007
      Metal Family: Supported, Metal GPUFamily macOS 2
      Displays:
        Color LCD:
          Display Type: Built-In Retina LCD
          Resolution: 2560 x 1600 Retina
          Framebuffer Depth: 30-Bit Color (ARGB2101010)
          Main Display: Yes
          Mirror: Off
          Online: Yes
          Automatically Adjust Brightness: Yes
          Connection Type: Internal
        DELL U2415:
          Resolution: 1920 x 1200 (WUXGA - Widescreen Ultra eXtended Graphics Array)
          UI Looks like: 1920 x 1200 @ 60.00Hz
          Framebuffer Depth: 30-Bit Color (ARGB2101010)
          Display Serial Number: XYHT89BO1LML
          Mirror: Off
          Online: Yes
          Rotation: Supported
          Automatically Adjust Brightness: Yes
          Connection Type: DVI or HDMI
          Adapter Firmware Version: 7.55

Locale: (None, 'UTF-8')
PyQt5 5.15.2, Qt 5.15.2
Installed Packages:
    alabaster: 0.7.12
    appdirs: 1.4.4
    appnope: 0.1.2
    Babel: 2.9.0
    backcall: 0.2.0
    blockdiag: 2.0.1
    certifi: 2020.12.5
    cftime: 1.4.1
    chardet: 3.0.4
    ChimeraX-AddCharge: 1.1
    ChimeraX-AddH: 2.1.6
    ChimeraX-AlignmentAlgorithms: 2.0
    ChimeraX-AlignmentHdrs: 3.2
    ChimeraX-AlignmentMatrices: 2.0
    ChimeraX-Alignments: 2.1
    ChimeraX-AmberInfo: 1.0
    ChimeraX-Arrays: 1.0
    ChimeraX-Atomic: 1.16
    ChimeraX-AtomicLibrary: 3.1.2
    ChimeraX-AtomSearch: 2.0
    ChimeraX-AtomSearchLibrary: 1.0
    ChimeraX-AxesPlanes: 2.0
    ChimeraX-BasicActions: 1.1
    ChimeraX-BILD: 1.0
    ChimeraX-BlastProtein: 1.1
    ChimeraX-BondRot: 2.0
    ChimeraX-BugReporter: 1.0
    ChimeraX-BuildStructure: 2.5.2
    ChimeraX-Bumps: 1.0
    ChimeraX-BundleBuilder: 1.1
    ChimeraX-ButtonPanel: 1.0
    ChimeraX-CageBuilder: 1.0
    ChimeraX-CellPack: 1.0
    ChimeraX-Centroids: 1.1
    ChimeraX-ChemGroup: 2.0
    ChimeraX-Clashes: 2.1
    ChimeraX-ColorActions: 1.0
    ChimeraX-ColorGlobe: 1.0
    ChimeraX-ColorKey: 1.3
    ChimeraX-CommandLine: 1.1.3
    ChimeraX-ConnectStructure: 2.0
    ChimeraX-Contacts: 1.0
    ChimeraX-Core: 1.3.dev202104160519
    ChimeraX-CoreFormats: 1.0
    ChimeraX-coulombic: 1.2
    ChimeraX-Crosslinks: 1.0
    ChimeraX-Crystal: 1.0
    ChimeraX-CrystalContacts: 1.0
    ChimeraX-DataFormats: 1.1
    ChimeraX-Dicom: 1.0
    ChimeraX-DistMonitor: 1.1.1
    ChimeraX-DistUI: 1.0
    ChimeraX-Dssp: 2.0
    ChimeraX-EMDB-SFF: 1.0
    ChimeraX-ExperimentalCommands: 1.0
    ChimeraX-FileHistory: 1.0
    ChimeraX-FunctionKey: 1.0
    ChimeraX-Geometry: 1.1
    ChimeraX-gltf: 1.0
    ChimeraX-Graphics: 1.1
    ChimeraX-Hbonds: 2.1
    ChimeraX-Help: 1.1
    ChimeraX-HKCage: 1.3
    ChimeraX-IHM: 1.1
    ChimeraX-ImageFormats: 1.1
    ChimeraX-IMOD: 1.0
    ChimeraX-IO: 1.0.1
    ChimeraX-ItemsInspection: 1.0
    ChimeraX-Label: 1.1
    ChimeraX-ListInfo: 1.1.1
    ChimeraX-Log: 1.1.2
    ChimeraX-LookingGlass: 1.1
    ChimeraX-Maestro: 1.8.1
    ChimeraX-Map: 1.1
    ChimeraX-MapData: 2.0
    ChimeraX-MapEraser: 1.0
    ChimeraX-MapFilter: 2.0
    ChimeraX-MapFit: 2.0
    ChimeraX-MapSeries: 2.1
    ChimeraX-Markers: 1.0
    ChimeraX-Mask: 1.0
    ChimeraX-MatchMaker: 1.2
    ChimeraX-MDcrds: 2.2
    ChimeraX-MedicalToolbar: 1.0.1
    ChimeraX-Meeting: 1.0
    ChimeraX-MLP: 1.1
    ChimeraX-mmCIF: 2.3
    ChimeraX-MMTF: 2.1
    ChimeraX-Modeller: 1.0
    ChimeraX-ModelPanel: 1.1
    ChimeraX-ModelSeries: 1.0
    ChimeraX-Mol2: 2.0
    ChimeraX-Morph: 1.0
    ChimeraX-MouseModes: 1.1
    ChimeraX-Movie: 1.0
    ChimeraX-Neuron: 1.0
    ChimeraX-Nucleotides: 2.0.1
    ChimeraX-OpenCommand: 1.5
    ChimeraX-PDB: 2.4.1
    ChimeraX-PDBBio: 1.0
    ChimeraX-PDBLibrary: 1.0
    ChimeraX-PDBMatrices: 1.0
    ChimeraX-PickBlobs: 1.0
    ChimeraX-Positions: 1.0
    ChimeraX-PresetMgr: 1.0.1
    ChimeraX-PubChem: 2.0.1
    ChimeraX-ReadPbonds: 1.0
    ChimeraX-Registration: 1.1
    ChimeraX-RemoteControl: 1.0
    ChimeraX-ResidueFit: 1.0
    ChimeraX-RestServer: 1.1
    ChimeraX-RNALayout: 1.0
    ChimeraX-RotamerLibMgr: 2.0
    ChimeraX-RotamerLibsDunbrack: 2.0
    ChimeraX-RotamerLibsDynameomics: 2.0
    ChimeraX-RotamerLibsRichardson: 2.0
    ChimeraX-SaveCommand: 1.4
    ChimeraX-SchemeMgr: 1.0
    ChimeraX-SDF: 2.0
    ChimeraX-Segger: 1.0
    ChimeraX-Segment: 1.0
    ChimeraX-SeqView: 2.4
    ChimeraX-Shape: 1.0.1
    ChimeraX-Shell: 1.0
    ChimeraX-Shortcuts: 1.1
    ChimeraX-ShowAttr: 1.0
    ChimeraX-ShowSequences: 1.0
    ChimeraX-SideView: 1.0
    ChimeraX-Smiles: 2.0.1
    ChimeraX-SmoothLines: 1.0
    ChimeraX-SpaceNavigator: 1.0
    ChimeraX-StdCommands: 1.4
    ChimeraX-STL: 1.0
    ChimeraX-Storm: 1.0
    ChimeraX-Struts: 1.0
    ChimeraX-Surface: 1.0
    ChimeraX-SwapAA: 2.0
    ChimeraX-SwapRes: 2.1
    ChimeraX-TapeMeasure: 1.0
    ChimeraX-Test: 1.0
    ChimeraX-Toolbar: 1.0.1
    ChimeraX-ToolshedUtils: 1.1
    ChimeraX-Tug: 1.0
    ChimeraX-UI: 1.8
    ChimeraX-uniprot: 2.1
    ChimeraX-UnitCell: 1.0
    ChimeraX-ViewDockX: 1.0
    ChimeraX-Vive: 1.1
    ChimeraX-VolumeMenu: 1.0
    ChimeraX-VTK: 1.0
    ChimeraX-WavefrontOBJ: 1.0
    ChimeraX-WebCam: 1.0
    ChimeraX-WebServices: 1.0
    ChimeraX-Zone: 1.0
    colorama: 0.4.3
    comtypes: 1.1.7
    cxservices: 1.0
    cycler: 0.10.0
    Cython: 0.29.21
    decorator: 5.0.7
    distlib: 0.3.1
    docutils: 0.16
    filelock: 3.0.12
    funcparserlib: 0.3.6
    grako: 3.16.5
    h5py: 2.10.0
    html2text: 2020.1.16
    idna: 2.10
    ihm: 0.17
    imagecodecs: 2020.5.30
    imagesize: 1.2.0
    ipykernel: 5.3.4
    ipython: 7.18.1
    ipython-genutils: 0.2.0
    jedi: 0.17.2
    Jinja2: 2.11.2
    jupyter-client: 6.1.7
    jupyter-core: 4.7.1
    kiwisolver: 1.3.1
    line-profiler: 2.1.2
    lxml: 4.6.2
    lz4: 3.1.0
    MarkupSafe: 1.1.1
    matplotlib: 3.3.2
    msgpack: 1.0.0
    netCDF4: 1.5.4
    networkx: 2.5
    numexpr: 2.7.3
    numpy: 1.19.2
    numpydoc: 1.1.0
    openvr: 1.14.1501
    packaging: 20.9
    ParmEd: 3.2.0
    parso: 0.7.1
    pexpect: 4.8.0
    pickleshare: 0.7.5
    Pillow: 7.2.0
    pip: 21.0.1
    pkginfo: 1.5.0.1
    prompt-toolkit: 3.0.18
    psutil: 5.7.2
    ptyprocess: 0.7.0
    pycollada: 0.7.1
    pydicom: 2.0.0
    Pygments: 2.7.1
    PyOpenGL: 3.1.5
    PyOpenGL-accelerate: 3.1.5
    pyparsing: 2.4.7
    PyQt5-commercial: 5.15.2
    PyQt5-sip: 12.8.1
    PyQtWebEngine-commercial: 5.15.2
    python-dateutil: 2.8.1
    pytz: 2021.1
    pyzmq: 22.0.3
    qtconsole: 4.7.7
    QtPy: 1.9.0
    RandomWords: 0.3.0
    requests: 2.24.0
    scipy: 1.5.2
    setuptools: 50.3.2
    sfftk-rw: 0.6.7.dev1
    six: 1.15.0
    snowballstemmer: 2.1.0
    sortedcontainers: 2.2.2
    Sphinx: 3.2.1
    sphinxcontrib-applehelp: 1.0.2
    sphinxcontrib-blockdiag: 2.0.0
    sphinxcontrib-devhelp: 1.0.2
    sphinxcontrib-htmlhelp: 1.0.3
    sphinxcontrib-jsmath: 1.0.1
    sphinxcontrib-qthelp: 1.0.3
    sphinxcontrib-serializinghtml: 1.1.4
    suds-jurko: 0.6
    tables: 3.6.1
    tifffile: 2020.9.3
    tinyarray: 1.2.3
    tornado: 6.1
    traitlets: 5.0.5
    urllib3: 1.25.11
    wcwidth: 0.2.5
    webcolors: 1.11.1
    wheel: 0.36.0
    wheel-filename: 1.2.0
File attachment: volumesilh.tif

volumesilh.tif

Attachments (1)

volumesilh.tif (2.0 MB ) - added by jmeyerow@… 5 years ago.
Added by email2trac

Change History (11)

by jmeyerow@…, 5 years ago

Attachment: volumesilh.tif added

Added by email2trac

comment:1 by pett, 5 years ago

Component: UnassignedGraphics
Owner: set to Tom Goddard
Platform: all
Project: ChimeraX
Status: newassigned
Summary: ChimeraX bug report submissionSilhouettes look wrong

Reported by Justin Meyerowitz

comment:2 by Tom Goddard, 5 years ago

This silhouette bug was reported once before 2 months ago on an identical model MacBookPro16,2 with Intel graphics and 10-bit color, bug report #4273 (https://www.rbvi.ucsf.edu/trac/ChimeraX/ticket/4273) both running macOS Big Sur (11.1 in this bug report, 11.2.1 in previous one). Tests on a slightly older MacBookPro15,3 with Radeon and Intel graphics and macOS Catalina does not have the problem, nor does an iMac18,3 with macOS 11.2.3 with Radeon graphics and 10-bit color depth show the problem.

This bug appears to be an Apple graphics driver bug, or an unusual graphics driver behavior that ChimeraX does not handle, specific to this MacBookPro model with Intel graphics and 10-bit color. I don't have a machine where I can reproduce the problem so I have no way to debug it.

It looks like the previous report said the problem is only on transparent surfaces. Is that the case for you? Do silhouettes work correctly for opaque surfaces?

in reply to:  4 comment:3 by jmeyerow@…, 4 years ago

Hello Tom,

Thank you for looking into this. This behavior occurs with both opaque and transparent surfaces, but with opaque surfaces it is much less. I’m trying to prepare figures for a manuscript, any ideas as to a workaround?
Justin


in reply to:  5 ; comment:4 by jmeyerow@…, 4 years ago

I have more information for you:
This bug occurs in two scenarios, from what I’ve found: 1) If map is set to Opacity <100%, or 2) if map is Opacity 100% but simultaneously displayed with model. 
Hope this is helpful.


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

Hi Justin,

  This problem with silhouette edges has only been reported twice, both on with the same exact MacBook Pro model and graphics and has not reproduced on all the machines I have available.  So if you can use any other computer it will not have the problem.  This is an Apple graphics drive issue.  Probably that does not help.  Another idea is if you could plug your laptop into an external screen, like a TV say with 8-bit color that may fix it when using ChimeraX on that screen.  I am not certain of that (since I have no machine I can test your problem on) but I think there is a 50% chance that the 10-bit color display is part of the problem (though not all of it since my 10-bit iMac with Radeon graphics does not have the problem).

  Now to the practical solutions.  Don't use silhouette edges.  Save ChimeraX sessions for each figure on your laptop (that should always be done so figures can be updated later).  Then if another computer is available some day, copy the sessions to that computer and save images on that computer.  Sessions are completely portable (as long as you use the same or newer ChimeraX version). Your figures probably have EM maps and those are not included in ChimeraX session files since it makes them huge, so those would have to be copied to the other machine.  You might want to save the sessions with the "includeMaps true" option  (save fig1.cxs includeMaps true) so that the session file does include the maps.

  Sorry, you are burned by a rare bug.  Apple does not care a bit about OpenGL graphics which is the standard cross-platform 3D graphics library, and we don't have any way to fix that.  I have worked around other Apple OpenGL bugs in ChimeraX, but without a machine to test work-arounds on I can't do anything about this one.

  	Tom


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

With a bit more thought I think the problem would probably not be fixed by using an 8-bit display.  My best guess is the problem is purely a graphics driver synchronization bug where the silhouette calculation starts using the per-pixel depth buffer before the depth buffer has been fully rendered.  The image is rendered in lots of patches on the GPU and many have not completed yet when it starts making the silhouettes.

in reply to:  8 ; comment:7 by goddard@…, 4 years ago

Your observations that it has weird dependencies on what is drawn support my theory about the cause.  If you really want to try something crazy, you could add a line of code to your ChimeraX that might fix the problem if my theory is correct.  I wouldn't say the chances are high.  But here is the modification.  In ChimeraX.app edit file

	ChimeraX.app/Contents/lib/python3.8/site-packages/chimerax/graphics/opengl.py

changing this routine

    def finish_silhouette_drawing(self, render):
        r = render
        fb = r.pop_framebuffer()
        cfb = r.current_framebuffer()
        cfb.copy_from_framebuffer(fb, depth=False)
        self._draw_depth_outline(render, fb.depth_texture, self.thickness,
                                 self.color, self.depth_jump,
                                 self.perspective_near_far_ratio)

by adding one line to it (adding the r.finish_rendering() call).

    def finish_silhouette_drawing(self, render):
        r = render
	r.finish_rendering()
        fb = r.pop_framebuffer()
        cfb = r.current_framebuffer()
        cfb.copy_from_framebuffer(fb, depth=False)
        self._draw_depth_outline(render, fb.depth_texture, self.thickness,
                                 self.color, self.depth_jump,
                                 self.perspective_near_far_ratio)

Restart ChimeraX and test.  This line forces OpenGL to complete all graphics operations before moving on to draw the silhouettes.

in reply to:  9 ; comment:8 by goddard@…, 4 years ago

The added line has to have the same indentation of the line before it using spaces not tabs for Python to not give an error.


in reply to:  10 ; comment:9 by jmeyerow@…, 4 years ago

Thank you for the ideas for a workaround for figure generation, and for this suggestion to change the OpenGL script. I added the line and restarted, and the behavior is exactly the same. Viewing/rendering on an external monitor does not change the behavior either. 

What I will do is as you suggest--work on the drafts of these figures without silhouettes, and transfer to another machine to generate the final figures. I’m a huge fan of the new ChimeraX rendering options and aesthetics, I guess I just got unlucky with my specific machine configuration (and Apple’s disregard for OpenGL). 

Thank you so much for trying to figure this out. If more of this bug crops up, let me know if I can help in any way in trying to get to the bottom of it. 

Justin 





in reply to:  11 ; comment:10 by goddard@…, 4 years ago

Thanks for testing an external monitor and the OpenGL code change, sad that neither worked.  I am out of ideas for new ways to debug or work around this problem.  Progress would require me getting a machine that reproduces the bug and that is very unlikely.
Note: See TracTickets for help on using tickets.