SCIInstitute / map3d

Other
3 stars 3 forks source link

New Macs have distorted placement of geometry in the window #35

Closed rsmacleod closed 7 years ago

rsmacleod commented 7 years ago

map3dscreensnapz001 This is a new and weird one. With some of the new iMac and also MacBooks, the main window opens but the contents of the rendering are limited to the lower left corner of the window. Even more confusing, the rendering is limited to the space it initially occupies, i.e., scaling does not allow the contents to expand beyond the initial window so most of the original window remains empty.
And even weirder, picking nodes fails unless the user picks in the part of the original window in which there is no rendered content! Picking within the small window that holds the data display does not work. I have no screen dumps yet for this but we will add them. Of course, it is a hardware or driver problem so I am not sure where to start looking or who will be best to do the looking.

bryanworthen commented 7 years ago

This is completely insane. Some cursory research indicates that Qt treats retina displays a little weirdly - i.e., that in some contexts a pixel is just a pixel, but in other cases, what was previously a pixel is now a "device-independent point".

http://blog.qt.io/blog/2013/04/25/retina-display-support-for-mac-os-ios-and-x11/ mentions this as a direct quote:

For example, a 100×100 window occupies the same area on screen on a normal and high-dpi screen (everything else being equal). On the high-dpi screen the window’s backing store contains 200×200 pixels.

It also mentions OpenGL, like: OpenGL is a device pixel based API and remains so in high-dpi mode. There is a flag on NSView to enable/disable the 2x scaling – Qt sets it in all cases. Shaders run in device pixels.

I'll play with that some.

rsmacleod commented 7 years ago

Yes, this is bizarre and frustrating to have to deal with. Surely there is a correct and robust way to handle the new high res displays? I am about to get my first UHD display for a new Mac Mini I got. So I can play with whatever you figure out. Thanks, Rob

jessdtate commented 7 years ago

I tested this bug out on my laptop attached to a 4k display. I see the bug (renderer only occupies a quarter of the window) on my display, but when I connect to the display I see different results. If the screens are mirrored, the scene is rendered normally, ie the scene takes up the full window, on both screens. If the screens are connected as dual monitors, the scene has a bug on my laptop screen, but not the monitor.

I attached a movie of the window moving back and forth. I could only capture one screen at a time, but you should be able to see the scene switch from full size to quarter sized and back as it is moved back and forth from the screens.

map3d_bug_720.mov.zip

bryanworthen commented 7 years ago

I have attempted a fix (that I can't test). If you can build from source (master) would you try it out?

Thanks, Bryan

On Wed, Aug 30, 2017 at 1:00 PM, Jess Tate notifications@github.com wrote:

I tested this bug out on my laptop attached to a 4k display. I see the bug (renderer only occupies a quarter of the window) on my display, but when I connect to the display I see different results. If the screens are mirrored, the scene is rendered normally, ie the scene takes up the full window, on both screens. If the screens are connected as dual monitors, the scene has a bug on my laptop screen, but not the monitor.

I attached a movie of the window moving back and forth. I could only capture one screen at a time, but you should be able to see the scene switch from full size to quarter sized and back as it is moved back and forth from the screens.

map3d_bug_720.mov.zip https://github.com/SCIInstitute/map3d/files/1264737/map3d_bug_720.mov.zip

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/SCIInstitute/map3d/issues/35#issuecomment-326087371, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQy7q7eJoCHs9ba_QTx3_SCErVoLzaVks5sdbFpgaJpZM4OajjV .

jessdtate commented 7 years ago

That fixed it. Great job.

rsmacleod commented 7 years ago

Fabulous!! Thanks Bryan.

jessdtate commented 7 years ago

There is another consideration that I didn't encounter before. Picking was and still is a problem for these screens. Before the fix, the visualization was in the the bottom quarter, but to pick points to view the time tracings, the users has to click on (presumable) the position it would be if it was full screen. The recent fix scales the picking as well as the visualization. Here are a couple videos illustrating the picking before and after the fix.

picking_bug_720.mov.zip picking_bug_2.mov.zip

bryanworthen commented 7 years ago

Okay. Please update and try again.

Please also see what happens when you interact with the time series window, and whether the legend window displays appropriately.

Thanks, Bryan

On Thu, Aug 31, 2017 at 12:52 PM, Jess Tate notifications@github.com wrote:

There is another consideration that I didn't encounter before, but picking was and still is a problem for these screens. Before the fix, the visualization was in the the bottom quarter, but to pick points to view the time tracings, the users has to click on (presumable) the position it would be if it was full screen. The recent fix scales the picking as well as the visualization. Here are a couple videos illustrating the picking before and after the fix.

picking_bug_720.mov.zip https://github.com/SCIInstitute/map3d/files/1268181/picking_bug_720.mov.zip picking_bug_2.mov.zip https://github.com/SCIInstitute/map3d/files/1268180/picking_bug_2.mov.zip

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/SCIInstitute/map3d/issues/35#issuecomment-326388528, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQy7suhQ7lk8GjzMunFFu5w0Eo6VbWeks5sdwDYgaJpZM4OajjV .

jessdtate commented 7 years ago

I tested this my machines with and without retina displays, I find no problems with any of the windows or the picking.

bryanworthen commented 7 years ago

Great! Thanks! Bryan

On Fri, Sep 8, 2017 at 3:39 PM, Jess Tate notifications@github.com wrote:

I tested this my machines with and without retina displays, I find no problems with any of the windows or the picking.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/SCIInstitute/map3d/issues/35#issuecomment-328220278, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQy7l74YbnZNRPoVbyFf4FM-1Dv8cY-ks5sgbQSgaJpZM4OajjV .

bryanworthen commented 7 years ago

Fix confirmed by Jess.