Opened 8 years ago

Closed 8 years ago

#767 closed defect (nonchimerax)

image save from this session gives quadrant missing silhouette edges

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

On my Mac laptop with Intel graphics,

OpenGL version: 4.1 INTEL-10.25.13
OpenGL renderer: Intel Iris Pro OpenGL Engine
OpenGL vendor: Intel Inc.

if I save an image with or without supersampling after restoring the attached session, it only has a fraction of what is shown in the window, and it lacks silhouette edges. If I close that and open something else, it has the same problems. However, if I start ChimeraX afresh before opening something else, a saved image does not have these problems. Don't know what combination of factors in this session causes the problem, because if I simply run the original script used in making that session, it does not get into that bad state. Even if I then save ANOTHER session and then restore that, the image is not messed up.

The session was saved with only yesterday's daily build, and I probably did some other things before saving it, but nothing obvious that I recall.

Attachments (3)

kmorph.cxs (1.2 MB ) - added by Elaine Meng 8 years ago.
image.png (156.6 KB ) - added by Elaine Meng 8 years ago.
example of output image (this was supersample 1, but supersample 3 has the same major problems)
image-after-resize.png (83.5 KB ) - added by Elaine Meng 8 years ago.
crazy image with displaced silhouettes saved after opening session, then resizing the window

Download all attachments as: .zip

Change History (20)

by Elaine Meng, 8 years ago

Attachment: kmorph.cxs added

comment:1 by Elaine Meng, 8 years ago

Owner: set to Tom Goddard

Reassign/reclassify as needed.

comment:2 by Tom Goddard, 8 years ago

If you open the session, resize the ChimeraX window by hand, then save an image does it work?

by Elaine Meng, 8 years ago

Attachment: image.png added

example of output image (this was supersample 1, but supersample 3 has the same major problems)

comment:3 by Tom Goddard, 8 years ago

The image saves correctly on my iMac after opening this session. Also tried resaving this session with a larger size than ChimeraX starts with on my large screen -- restarting ChimeraX and restoring that session, image save still works.

comment:4 by Elaine Meng, 8 years ago

HAHAHA got a humorous result from opening the session and resizing, then saving the image. Now I see some silhouettes displaced from the structure. I'll also attach image-after-resize.png.

You may recall that this is the same computer that gave the cheshire cat silhouettes still shown after I closed the structures, although I think they went away when I resized.

comment:5 by Tom Goddard, 8 years ago

Is your display a retina display? Because this image looks like it may be exactly the lower left octant which could happen if the graphics size was off by a factor of 2 because of some mix-up with retina vs non-retina.

by Elaine Meng, 8 years ago

Attachment: image-after-resize.png added

crazy image with displaced silhouettes saved after opening session, then resizing the window

comment:6 by Tom Goddard, 8 years ago

The silhouettes also look 2x too big, suggesting again that ChimeraX is confused about whether this is a retina display or not.

in reply to:  10 comment:7 by Elaine Meng, 8 years ago

Would it matter that the session was saved from a machine without retina display and then opened on one with a retina display?

comment:8 by Tom Goddard, 8 years ago

ChimeraX asks Qt if the display is a retina display, it does not come from the session. But the session does include the graphics window size and that session window size might look 2x smaller on a retina display then the corresponding window on a non-retina display. I have a retina mac laptop at home and can test your session on that.

comment:9 by Tom Goddard, 8 years ago

Tested this on my MacbookPro 2012 laptop and image save worked correctly after session restore. My laptop has nvidia graphics and Intel integrated graphics. I forced it to use Intel graphics (normally it uses the more powerful nvidia graphics), and still it saved the image after opening the session correctly. This test was with Mac OS 10.12.6. What version of MacOS are you using?

comment:10 by Elaine Meng, 8 years ago

Oops accidentally ran software update on my laptop before checking... so it may have been a lower version before, but even after the software update to 10.12.6, an image saved from that session has the same problems.

comment:11 by Tom Goddard, 8 years ago

Here is a fix you could try for the broken image saving. It involves adding a line of code to ChimeraX in file

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

at line 773 add the line

GL.glFinish()

as shown in the following code. Then start ChimeraX and try saving the bad images. This line forces OpenGL to finish all queued graphics before it captures the image.

def frame_buffer_image(self, w, h, rgba = None, front_buffer = False):


Return the current frame buffer image as a numpy uint8 array of
size (h, w, 4) where w and h are the framebuffer width and height.
The four components are red, green, blue, alpha. Array index 0,
0 is at the bottom left corner of the OpenGL viewport.

GL.glFinish()
if rgba is None:

from numpy import empty, uint8
rgba = empty((h, w, 4), uint8)

if front_buffer:

GL.glReadBuffer(GL.GL_FRONT)

GL.glReadPixels(0, 0, w, h, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, rgba)
if front_buffer:

GL.glReadBuffer(GL.GL_BACK)

return rgba

comment:12 by Tom Goddard, 8 years ago

Elaine reports:

Nope … pretty sure I did what you said, but the image saved afterwards looks exactly the same.

comment:13 by Tom Goddard, 8 years ago

Ok, my other theory is that this relates to ChimeraX being confused about a retina display.

Is your display a retina display? Because this image looks like it may be exactly the lower left octant which could happen if the graphics size was off by a factor of 2 because of some mix-up with retina vs non-retina.

If you get a System Report for your Mac, look at Hardware / Graphics and Displays and see what the display resolution is.

Unfortunately ChimeraX worked correctly on my MacBook Pro with retina display. So if yours is retina I don't have an idea what to try. I'd probably have to use your laptop myself to find some lead. I still believe it is most likely a graphics driver issue.

in reply to:  17 comment:14 by Elaine Meng, 8 years ago

Yes, retina display, but also yes, probably graphics driver and not worth wasting more of your time unless we get a raft of other people complaining about the same thing.  This is the same laptop with sporadic cheshire-cat silhouette edges, although those were at least in the right size and position.  Here’s the system report for graphics hardware:

Intel Iris Pro:

  Chipset Model:	Intel Iris Pro
  Type:	GPU
  Bus:	Built-In
  VRAM (Dynamic, Max):	1536 MB
  Vendor:	Intel (0x8086)
  Device ID:	0x0d26
  Revision ID:	0x0008
  Metal:	Supported
  Displays:
Color LCD:
  Display Type:	Built-In Retina LCD
  Resolution:	2880 x 1800 Retina
  Pixel Depth:	32-Bit Color (ARGB8888)
  Main Display:	Yes
  Mirror:	Off
  Online:	Yes
  Rotation:	Supported
  Automatically Adjust Brightness:	No
  Connection Type:	DisplayPort


 

in reply to:  18 comment:15 by goddard@…, 8 years ago

Ok.  If you want me to pursue it further I’d probably need to be able to test on your laptop myself.  Otherwise we can drop it.

in reply to:  19 comment:16 by Elaine Meng, 8 years ago

I think we can drop it.  Couldn’t figure out the Cheshire-cat silhouettes either.  The reason I report these things is that so we have  a record that they happened to somebody, not because I’m expecting a fix, or even consider them fixable by us. Thanks for looking into it, though.

comment:17 by Tom Goddard, 8 years ago

Resolution: nonchimerax
Status: assignedclosed

Mac Intel graphics driver bug.

Note: See TracTickets for help on using tickets.