-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scissor test failure on Mac #136
Comments
So the Mac retina display is a display where each point on the screen is a square of four pixels. OpenGL doesn't know about points, so a Mac OpenGL application has two options. The default "lo-res" option is to request a viewport size based on points and then double everything in both directions to map it to pixels. The "hi-res" option is to request a viewport size based on pixels instead of points. What seems to be happening here is that OpenGL is rendering everything, then doubling it up, and then applying the scissor test without first doubling the coordinates of the scissor rectangle. Consequently, it's scissoring the bottom left quarter of the window instead of the whole one. Could it be a buggy driver? |
Just to provide screenshot machine context, this is a retina Macbook Pro running the latest public beta of 10.10.4 with up-to-date drivers -- the resolution where the problem happens is 1440x900HiDPI — I can fix it by disabling the HiDPI mode but this causes havoc for other applications (you need special software to disable a HiDPI mode, OS X doesn't allow this normally). Most of the rest of Oolite works fine, and rendering is nice and crisp in HiDPI mode, it doesn't look fuzzy etc. |
Kevin, remember the code you had written when you initially implemented the scrolling chart feature? The code which was removed soon after we found that the scissor test method does exactly what we wanted but much faster? In case there is no fix to this issue soon, how about re-introducing that code for Mac only and make the game switch to it via an e.g. defaults file setting? I know it is not the perfect fix, but given the absence of our Mac maintainers, maybe this could be a way out of the problem, at the expense of speed of scrolling on retina Macs. What do you think? |
I'm looking at this Mac code in MyOpenGLView.m:
I've got a hunch that if we insert a It's probably worth trying that before the nasty hack. I'll look into it a bit more this evening. |
@iandol Kevin commited an attempted fix a little while ago. Can you please test tomorow's nightly build and let us know if it has resolved the problem? |
Did we get any build errors? |
Unfortunately it looks like the nightly build for Mac is stuck on May 5th. Last revision built was 389e3d4. We really need Mac maintainers to look at this or feedback from iandol, in case he can build the source himself. |
Sadly I can't build oolite, so I'll have to wait for a new nightly before I can confirm a fix. Thanks for looking at this!!! |
If you want to give it a go (no pressure if you don't), you just need a git client (available free from http://git-scm.com/) and xcode (available free from the app store). To check out the source code using git, open a command line and run
(There'll be an equivalent procedure with one of the gui clients, but you'll be on your own with those.) This will create a folder called |
I get the following build errors/warnings:
It offered me a chance to auto-fix it which I tried but then I got the following error:\
|
Thanks very much. I think I've fixed the error, although I've only done what the auto fix probably did. To fetch the changes, command line again and
to clear any changes made by the autofix (notice the
And then try another build. And again, thanks for your help! |
So, I clean (⇧⌘K) then I run (⌘R, I also tried building then manually running the app in the Products/ folder) in XCode and no build errors, then I start a new commander in strict mode but I still see this problem :-( My source tree is on cd71bf1 |
Note, I also tried to build oolite - Deployment just in case it was somehow differenrt and got this build error:
|
The fix isn't enabled by default, in case it breaks stuff for non-retina users. To enable it (I'm blagging the instructions from here), try the following from the command line:
where I'm guessing that the first fix might work, or it might restrict Oolite to the bottom left hand corner of the window, in which case try fix number 2. |
Value 1: still broken |
Bugger! From the command line again, try
and try another build, then set the |
Value 3 (with commit 1667290) shows oolite in the bottom left quadrant, with the star map properly drawn at least!: |
OK then:
Then build, and
|
So on commit 2d926ab with YES as the defaults: But then I tried cycling through the other options again just in case and on value==1 it now seems to work!!! Double checking the value:
I can't see any flickering or problems with mouse co-ordinates etc. I'm a newbie ooliter so I could have missed something but it all seems OK. Well done!!! |
Yay! I'll take that! By the way, I got the command wrong - it should have been
The issue you had with the truncated screen shots probably hasn't been fixed (I've just remembered about that). Can you give that a try? |
Screenshots are still truncated in windowed or full-screen mode, but system screen shots work fine so this isn't a major platform issue. Congrats on the fix! |
I also tried switching to master and pulling the changes there and star map still works fine... |
I think I've fixed the screenshot bug as well, so that's
Thanks for the help! |
Screenshots also fixed :-) 👍 |
Fantastic! Thanks again for all the help with that! |
As reported on the BB here, the scissor test in the short range chart screen fails:
The problem appears to be confusion between points and pixels on the Mac retina screen. There is some deleveloper information available which may help solve this problem.
The text was updated successfully, but these errors were encountered: